Skip to content

PedroManse/supera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supera

Supervisor for Running code Asynchronously1

Command

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.

Runner

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.

Manager

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

Native managers

There are four execution managers

Response method Many runners Single runner
Ordered PoolQueueAPI SingleQueueAPI
Linked2 OneShotPoolAPI OneShotAPI

Footnotes

  1. Code will not execute on an async runtime. It will simply execute on one or more worker threads

  2. A Linked manager will create a single-use channel for each request sent. This incurs some cost but greatly simplifies their usage.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published