Crate orchestra

Source
Expand description

§Orchestra

orchestra provides a global information flow system in reference to system specifc process tokens. The token is arbitrary, but is used to notify all Subsystems of what is relevant and what is not, leading to a so called view of active tokens.

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 - called Subsystems in the orchestra scope - communicate with each other, but that is not enforced and is the responsibility of the developer.

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  |  .
            .  +--------------------+               +---------------------+  .
            .                                                                .
            ..................................................................

Structs§

HighPriority
High priority.
MessagePacket
A wrapping type for messages.
NormalPriority
Normal priority.
SignalsReceived
Watermark to track the received signals.
SpawnedSubsystem
An asynchronous subsystem task..
SubsystemInstance
A running instance of some Subsystem.
SubsystemMeterReadouts
Set of readouts of the Meters of a subsystem.
SubsystemMeters
Collection of meters related to a subsystem.
Timeout
A future that wraps another future with a Delay allowing for time-limited futures.

Enums§

FromOrchestra
A message type that a subsystem receives from an orchestra. It wraps signals from an orchestra and messages that are circulating between subsystems.
OrchestraError
An error type that describes faults that may happen
PriorityLevel
Priority of messages sending to the individual subsystems. Only for the bounded channel sender.
ToOrchestra
A type of messages that are sent from a Subsystem to the declared orchestra.

Traits§

AnnotateErrorOrigin
A trait to support the origin annotation such that errors across subsystems can be easier tracked.
MapSubsystem
A helper trait to map a subsystem to smth. else.
Priority
Describes the priority of the message.
Spawner
A spawner
Subsystem
A trait that describes the Subsystems that can run on the Orchestra.
SubsystemContext
A context type that is given to the Subsystem upon spawning. It can be used by Subsystem to communicate with other Subsystems or spawn jobs.
SubsystemSender
Sender end of a channel to interface with a subsystem.
TimeoutExt
Extends Future to allow time-limited futures.

Functions§

make_packet
Create a packet from its parts.
select_message_channel_strategy
A functor to specify strategy of the channels selection in the SubsystemIncomingMessages

Type Aliases§

OrchestraResult
Alias for a result with error type OrchestraError.
SubsystemIncomingMessages
Incoming messages from both the bounded and unbounded channel.

Attribute Macros§

contextbounds
orchestra
subsystem