Lines Matching refs:pool
50 from .pool import *
107 pool = Pool(4) # start worker threads
110 assert pool.map(return42, []) == []
111 assert pool.apply_async(return42, []).get() == 42
112 assert pool.apply(return42, []) == 42
113 assert list(pool.imap(return42, iter([]))) == []
114 assert list(pool.imap_unordered(return42, iter([]))) == []
115 assert pool.map_async(return42, []).get() == []
116 assert list(pool.imap_async(return42, iter([])).get()) == []
117 assert list(pool.imap_unordered_async(return42, iter([])).get()) == []
120 result = pool.apply_async(f, (10,)) # evaluate "f(10)" asynchronously
122 assert list(pool.map(f, range(10))) == list(map(f, range(10)))
123 it = pool.imap(f, range(10))
130 result = pool.apply_async(timeout_work, (None,))
138 assert list(pool.imap(work, range(10, 3, -1), chunksize=4)) == list(map(
142 assert sorted(pool.imap_unordered(work, range(10, 3, -1))) == sorted(map(
147 result = pool.map_async(timeout_work, range(10), callback=cb)
153 result = pool.imap_async(timeout_work, range(3, 10), callback=cb)
163 result = pool.imap_unordered_async(timeout_work, range(10, 3, -1), callback=cb)
182 result = pool.imap_unordered_async(work, range(2, -10, -1), callback=cb)
191 result = pool.imap_async(work, range(2, -10, -1), callback=cb)
200 pool.terminate()
201 pool.join()