Base

Executor without parallelism for debugging

class orion.executor.single_backend.SingleExecutor(n_workers=1, **config)[source]

Single thread executor

Simple executor for debugging. No parameters.

The submitted functions are wrapped with functools.partial which are then executed in wait().

Notes

The tasks are started when wait is called

Methods

async_get(futures[, timeout])

Retrieve futures that completed, removes them from the list of pending futures and return their results

close()

Prevent user from submitting work after closing.

submit(function, *args, **kwargs)

Submit work to the executor for asynchronous execution

wait(futures)

Wait for all futures to complete execution.

async_get(futures, timeout=0.01)[source]

Retrieve futures that completed, removes them from the list of pending futures and return their results

Parameters
futures: `concurrent.futures.Futures` or equivalent interface

The objects returned by submit() of the executor.

timeout: int

time to wait before checking the other future

Returns
returns a list of results
close()[source]

Prevent user from submitting work after closing.

submit(function, *args, **kwargs)[source]

Submit work to the executor for asynchronous execution

Parameters
function: a callable object

A function to be executed by the executor. The function must be serializable.

*args, **kwargs:

Arguments for the function. The arguments must be serializable.

wait(futures)[source]

Wait for all futures to complete execution.

Parameters
futures: `concurrent.futures.Futures` or equivalent interface

The objects returned by submit() of the executor.