• Home
  • Raw
  • Download

Lines Matching +full:source +full:- +full:compatible

27 STACK_DEBUG = logging.DEBUG - 1  # heavy-duty debugging
31 """This class is *almost* compatible with concurrent.futures.Future.
35 - This class is not thread-safe.
37 - result() and exception() do not take a timeout argument and
40 - Callbacks registered with add_done_callback() are always called
43 - This class is not compatible with the wait() and as_completed()
60 # - Its presence is a marker to declare that a class implements
61 # the Future protocol (i.e. is intended to be duck-type compatible).
62 # The value must also be not-None, to enable a subclass to declare
63 # that it is not compatible by setting this to None.
64 # - It is set by __iter__() below so that Task._step() can tell
225 The callback is called with a single argument - the future object. If
246 removed_count = len(self._callbacks) - len(filtered_callbacks)
251 # So-called internal methods (note: no set_running_or_notify_cancel()).
292 __iter__ = __await__ # make compatible with 'yield from'.
330 def _set_concurrent_future_state(concurrent, source): argument
332 assert source.done()
333 if source.cancelled():
337 exception = source.exception()
341 result = source.result()
345 def _copy_future_state(source, dest): argument
350 assert source.done()
354 if source.cancelled():
357 exception = source.exception()
361 result = source.result()
365 def _chain_future(source, destination): argument
368 The result (or exception) of source will be copied to destination.
369 If destination is cancelled, source gets cancelled too.
370 Compatible with both asyncio.Future and concurrent.futures.Future.
372 if not isfuture(source) and not isinstance(source,
374 raise TypeError('A future is required for source argument')
378 source_loop = _get_loop(source) if isfuture(source) else None
390 source.cancel()
392 source_loop.call_soon_threadsafe(source.cancel)
394 def _call_set_state(source): argument
399 _set_state(destination, source)
403 dest_loop.call_soon_threadsafe(_set_state, destination, source)
406 source.add_done_callback(_call_set_state)