Crate odem_rs_sync

Crate odem_rs_sync 

Source
Expand description

This part of the ODEM-rs simulation framework deals with synchronization and communication structures for the communication between Agent and Job.

The provided synchronization structures are generally implemented independently of the simulation domain but do make use of the fact that simulation runs are not distributed across different threads, i.e., they do not implement Sync.

Synchronization is an important aspect of agent-based simulation because it allows continuations to communicate and work cooperatively with each other.

Modules§

chain
A module containing a data structure for intrusively linked lists of notifyable objects that is used to construct Chains of Continuations on the stack.
channel
This module contains support for MPMC-channels which synchronize sender and receiver continuations over a message queue.
control
This module contains support for awaiting arbitrary state events in the form of control expressions.
error
A module for sync-specific error types.
facility
This module contains support for a GPSS-like facility.
fork
Provides support for agent-internal parallelism in simulation contexts.

Macros§

until
Creates a ControlExpr from a boolean expression, allowing asynchronous code to efficiently await a specific condition.

Structs§

Tuple
Newtype wrapping tuples of Subscriber/Publisher and implementing these traits itself.

Traits§

Publisher
A trait that allows continuations to subscribe for state changes and be reactivated when they occur.
Subscriber
A trait that allows notification of a state change.

Derive Macros§

Publisher
Derives the Publisher-trait for a structure.