Created
September 4, 2012 04:53
-
-
Save teepark/3616725 to your computer and use it in GitHub Desktop.
multiprocessing's threadpool on greenhouse emulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from greenhouse import emulation | |
| mp_pool = emulation.patched("multiprocessing.pool") | |
| def cb(x): | |
| print 'callback:', x | |
| tp = mp_pool.ThreadPool() | |
| tp.apply_async(lambda a, b: a * b, (4, 5), {}, cb) | |
| greenhouse.pause_for(0.1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment