Crate polkadot_node_subsystem::gen
source · Expand description
Orchestra
orchestra
provides a global information flow of what a token of information.
The token is arbitrary, but is used to notify all Subsystem
s of what is relevant
and what is not.
For the motivations behind implementing the orchestra itself you should check out that guide, documentation in this crate will focus and be of technical nature.
An Orchestra
is something that allows spawning/stopping and orchestrating
asynchronous tasks as well as establishing a well-defined and easy to use
protocol that the tasks can use to communicate with each other. It is desired
that this protocol is the only way tasks communicate with each other, however
at this moment there are no foolproof guards against other ways of communication.
The Orchestra
is instantiated with a pre-defined set of Subsystems
that
share the same behavior from Orchestra
’s point of view.
+-----------------------------+
| Orchesta |
+-----------------------------+
................| Orchestra "holds" these and uses |.............
. them to (re)start things .
. .
. +-------------------+ +---------------------+ .
. | Subsystem1 | | Subsystem2 | .
. +-------------------+ +---------------------+ .
. | | .
..................................................................
| |
start() start()
V V
..................| Orchestra "runs" these |.......................
. +--------------------+ +---------------------+ .
. | SubsystemInstance1 | <-- bidir --> | SubsystemInstance2 | .
. +--------------------+ +---------------------+ .
..................................................................
Modules
Macros
async
context.select!
must be Unpin
and implement FusedFuture
.Structs
Duration
type to represent a span of time, typically used for system
timeouts.Subsystem
.Meter
s of a subsystem.Delay
allowing for time-limited futures.Enums
SelectWithStrategy
which stream to poll next.Subsystem
to the declared orchestra.Traits
Future
s that provides a variety of convenient
adapters.Stream
s that provides a variety of convenient
combinator functions.Future
to allow time-limited futures.Functions
SubsystemIncomingMessages
SelectWithStrategy
which stream to poll. The closure can
store state on SelectWithStrategy
to which it will receive a &mut
on every
invocation. This allows basing the strategy on prior choices.Type Definitions
Future
for use in cases where you can’t
statically type your result or need to add some indirection.OrchestraError
.