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 inwait()
.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