kiwipy.futures module

kiwipy.futures.capture_exceptions(future, ignore=())[source]

Capture any exceptions in the context and set them as the result of the given future

Parameters
  • future (kiwipy.Future) – The future to the exception on

  • ignore – An optional list of exception types to ignore, these will be raised and not set on the future

kiwipy.futures.chain(source, target)[source]

Chain two futures together so that when one completes, so does the other.

The result (success or failure) of a will be copied to b, unless b has already been completed or cancelled by the time a finishes.

kiwipy.futures.copy_future(source, target)[source]

Copy the status of future a to b unless b is already done in which case return

Parameters
  • source (kiwipy.Future) – The source future

  • target (kiwipy.Future) – The target future