traits_futures.background_call module

Background task consisting of a simple callable.

class traits_futures.background_call.BackgroundCall[source]

Bases: traits.has_traits.HasStrictTraits

Object representing the background call to be executed.

args = Tuple()

Positional arguments to be passed to the callable.


Return a background callable for this task specification.


Callable accepting arguments send and cancelled. The callable can use send to send messages and cancelled to check whether cancellation has been requested.

Return type

callable = Callable()

The callable to be executed.


Return a Future for the background task.


future – Future object that can be used to monitor the status of the background task.

Return type


kwargs = Dict(Str())

Named arguments to be passed to the callable.

class traits_futures.background_call.CallBackgroundTask(callable, args, kwargs)[source]

Bases: object

Wrapper around the actual callable to be run. This wrapper provides the task that will be submitted to the concurrent.futures executor

class traits_futures.background_call.CallFuture[source]

Bases: traits_futures.base_future.BaseFuture

Object representing the front-end handle to a background call.

traits_futures.background_call.submit_call(executor, callable, *args, **kwargs)[source]

Convenience function to submit a background call to an executor.

  • executor (TraitsExecutor) – Executor to submit the task to.

  • callable ( – Callable to execute in the background.

  • *args – Positional arguments to pass to the callable.

  • **kwargs – Named arguments to pass to the callable.


future – Object representing the state of the background call.

Return type