Lines Matching refs:future
38 raise an exception when the future isn't done yet.
73 """Initialize the future.
76 loop object used by the future. If it's not provided, the future uses
101 'future': self,
147 """Cancel the future and schedule callbacks.
149 If the future is already done or cancelled, return False. Otherwise,
150 change the future's state to cancelled, schedule the callbacks and
176 """Return True if the future was cancelled."""
182 """Return True if the future is done.
185 future was cancelled.
190 """Return the result this future represents.
192 If the future has been cancelled, raises CancelledError. If the
193 future's result isn't yet available, raises InvalidStateError. If
194 the future is done and has an exception set, this exception is raised.
207 """Return the exception that was set on this future.
210 the future is done. If the future has been cancelled, raises
211 CancelledError. If the future isn't done yet, raises
223 """Add a callback to be run when the future becomes done.
225 The callback is called with a single argument - the future object. If
226 the future is already done when this is called, the callback is
254 """Mark the future done and set its result.
256 If the future is already done when this method is called, raises
266 """Mark the future done and set an exception.
268 If the future is already done when this method is called, raises
289 raise RuntimeError("await wasn't used with future")
312 """Helper setting the result only if the future was not cancelled."""
331 """Copy state from a future to a concurrent.futures.Future."""
374 raise TypeError('A future is required for source argument')
377 raise TypeError('A future is required for destination argument')
381 def _set_state(future, other):
382 if isfuture(future):
383 _copy_future_state(other, future)
385 _set_concurrent_future_state(future, other)
409 def wrap_future(future, *, loop=None):
411 if isfuture(future):
412 return future
413 assert isinstance(future, concurrent.futures.Future), \
414 f'concurrent.futures.Future is expected, got {future!r}'
418 _chain_future(future, new_future)