mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
Allow utils.worker to be joined explicitly
This commit is contained in:
@@ -785,14 +785,17 @@ class Worker:
|
||||
fn = self.q.get()
|
||||
try:
|
||||
fn()
|
||||
self.q.task_done()
|
||||
except:
|
||||
import traceback
|
||||
print traceback.format_exc()
|
||||
|
||||
|
||||
def do(self, fn):
|
||||
self.q.put(fn)
|
||||
|
||||
def join(self):
|
||||
self.q.join()
|
||||
|
||||
worker = Worker()
|
||||
|
||||
def cols(lst, ncols):
|
||||
|
||||
Reference in New Issue
Block a user