Lines Matching refs:futures
15 from concurrent import futures
16 from concurrent.futures._base import (
18 from concurrent.futures.thread import cpu_count
158 futures = [self.executor.submit(time.sleep, 0.1)
161 for f in futures:
166 executor_type = futures.ThreadPoolExecutor
170 executor_type = futures.ProcessPoolExecutor
215 with futures.ThreadPoolExecutor(max_workers=5) as e:
224 executor = futures.ThreadPoolExecutor(max_workers=5)
234 executor = futures.ThreadPoolExecutor(
246 executor = futures.ThreadPoolExecutor(max_workers=5)
275 with futures.ProcessPoolExecutor(max_workers=5) as e:
284 executor = futures.ProcessPoolExecutor(max_workers=5)
302 done, not_done = futures.wait(
304 return_when=futures.FIRST_COMPLETED)
312 finished, pending = futures.wait(
314 return_when=futures.FIRST_COMPLETED)
326 finished, pending = futures.wait(
328 return_when=futures.FIRST_EXCEPTION)
337 finished, pending = futures.wait(
342 return_when=futures.FIRST_EXCEPTION)
352 finished, pending = futures.wait(
354 return_when=futures.FIRST_EXCEPTION)
363 finished, pending = futures.wait(
369 return_when=futures.ALL_COMPLETED)
382 finished, pending = futures.wait(
388 return_when=futures.ALL_COMPLETED)
410 futures.wait(fs, return_when=futures.ALL_COMPLETED)
425 completed = set(futures.as_completed(
441 for future in futures.as_completed(
448 except futures.TimeoutError:
460 completed = [f for f in futures.as_completed([future1,future1])]
501 except futures.TimeoutError:
696 self.assertRaises(futures.TimeoutError,
698 self.assertRaises(futures.TimeoutError,
700 self.assertRaises(futures.CancelledError,
702 self.assertRaises(futures.CancelledError,
731 self.assertRaises(futures.CancelledError, f1.result, timeout=5)
734 self.assertRaises(futures.TimeoutError,
736 self.assertRaises(futures.TimeoutError,
738 self.assertRaises(futures.CancelledError,
740 self.assertRaises(futures.CancelledError,