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

Method run

recipes/Python/576576_Thread_Pool/recipe-576576.py:45–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

43 self.pool = pool
44 self.cmd=''
45 def run(self):
46 get=self.pool.jobs.get
47 while True:
48 cmd, args, kw, callback = get()
49 if cmd:
50 self.cmd=cmd.__name__
51 if callback:
52 callback(cmd(*args, **kw))
53 else:
54 cmd(*args, **kw)
55 self.cmd=''
56 else:
57 self.pool.workers.remove(self)
58 break
59
60if __name__=='__main__':
61

Callers 2

recipe-576574.pyFile · 0.45
do_printMethod · 0.45

Calls 4

cmdFunction · 0.85
getFunction · 0.50
callbackFunction · 0.50
removeMethod · 0.45

Tested by

no test coverage detected