Supervisor for Running code Asynchronously1
To use Supera a 'message' must be defined, an instance of the message must know
how to be executed. That is achieved by implementing the trait Command. The
message is then sent to a worker thread, what the worker does is implementation
specific.
All commands must define a signal to halt execution of the runner.
To acheive that StopRunner or SimpleStop can be defined.
StopRunner should be used in cases where there's valuable information to be
passed down to the runner when they are to be halted. Otherwise SimpleStop should be used.
Runners are worker threads created for the Manager. What they do is implementation specific. But the built-in runners acquire messages, execute them and in some form return the results to the user.
An execution manager implements the CommandRunner trait. So it's able to:
- Create it self and it's
Runners - Have a message sent to a
Runner - Close it self and all it's
Runners
There are four execution managers
| Response method | Many runners | Single runner |
|---|---|---|
| Ordered | PoolQueueAPI |
SingleQueueAPI |
| Linked2 | OneShotPoolAPI |
OneShotAPI |