MCPcopy Create free account
hub / github.com/ActiveState/code / run

Method run

recipes/Python/577187_Python_Thread_Pool/recipe-577187.py:12–17  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

10 self.start()
11
12 def run(self):
13 while True:
14 func, args, kargs = self.tasks.get()
15 try: func(*args, **kargs)
16 except Exception, e: print e
17 self.tasks.task_done()
18
19class ThreadPool:
20 """Pool of threads consuming tasks from a queue"""

Callers 1

recipe-577129.pyFile · 0.45

Calls 3

funcFunction · 0.50
getMethod · 0.45
task_doneMethod · 0.45

Tested by

no test coverage detected