Lines Matching refs:future
17 # Possible future states (for internal use by the futures package).
20 # The future was cancelled by the user...
46 """Base class for all future-related exceptions."""
65 def add_result(self, future):
66 self.finished_futures.append(future)
68 def add_exception(self, future):
69 self.finished_futures.append(future)
71 def add_cancelled(self, future):
72 self.finished_futures.append(future)
81 def add_result(self, future):
83 super(_AsCompletedWaiter, self).add_result(future)
86 def add_exception(self, future):
88 super(_AsCompletedWaiter, self).add_exception(future)
91 def add_cancelled(self, future):
93 super(_AsCompletedWaiter, self).add_cancelled(future)
99 def add_result(self, future):
100 super().add_result(future)
103 def add_exception(self, future):
104 super().add_exception(future)
107 def add_cancelled(self, future):
108 super().add_cancelled(future)
126 def add_result(self, future):
127 super().add_result(future)
130 def add_exception(self, future):
131 super().add_exception(future)
137 def add_cancelled(self, future):
138 super().add_cancelled(future)
148 for future in self.futures:
149 future._condition.acquire()
152 for future in self.futures:
153 future._condition.release()
181 Before yielding a future, *waiter* is removed from its waiters
182 and the future is removed from each set in the collection of sets
186 the future is yielded and before the iterator resumes.
274 FIRST_COMPLETED - Return when any future finishes or is
276 FIRST_EXCEPTION - Return when any future finishes by raising an
277 exception. If no future raises an exception
329 """Initializes the future. Should not be called by clients."""
365 """Cancel the future if possible.
367 Returns True if the future was cancelled, False otherwise. A future
384 """Return True if the future was cancelled."""
389 """Return True if the future is currently executing."""
394 """Return True if the future was cancelled or finished executing."""
409 """Attaches a callable that will be called when the future finishes.
412 fn: A callable that will be called with this future as its only
413 argument when the future completes or is cancelled. The callable
415 it was added. If the future has already completed or been
429 """Return the result of the call that the future represents.
432 timeout: The number of seconds to wait for the result if the future
436 The result of the call that the future represents.
439 CancelledError: If the future was cancelled.
440 TimeoutError: If the future didn't finish executing before the given
464 """Return the exception raised by the call that the future represents.
468 future isn't done. If None, then there is no limit on the wait
472 The exception raised by the call that the future represents or None
476 CancelledError: If the future was cancelled.
477 TimeoutError: If the future didn't finish executing before the given
498 """Mark the future as running or process any cancel notifications.
502 If the future has been cancelled (cancel() was called and returned
503 True) then any threads waiting on the future completing (though calls
506 If the future was not cancelled then it is put in the running state
507 (future calls to running() will return True) and True is returned.
510 executing the work associated with this future. If this method returns
538 """Sets the return value of work associated with the future.
553 """Sets the result of the future as being the given exception.
617 # Careful not to keep a reference to the popped future
623 for future in fs:
624 future.cancel()