Crate relay_system
source ·Expand description
Foundational system components for Relay’s services.
Relay’s system is based on [tokio
]. To use any of these components, ensure a tokio runtime is
available.
§Services
The basic building block in Relay are asynchronous Service
s. Each service implements an
Interface
, which consists of one or many messages that can be sent to the service using its
Addr
. See the docs of these types for more information on how to implement and use them.
§Shutdown
The static Controller
service can listen for process signals and initiate a graceful
shutdown. Note that services must check a ShutdownHandle
to receive these signals. See the
struct level documentation for more information.
Structs§
- The address of a
Service
. - Message response resulting in an asynchronous
Request
. - A channel that broadcasts values to attached senders.
- The request when sending an asynchronous message to a service.
- Variation of
AsyncResponse
that efficiently broadcasts responses to many requests. - Sends a message response from a service back to the waiting
BroadcastRequest
. - Service to start and gracefully stop the system runtime.
- Message response for fire-and-forget messages with no output.
- Inbound channel for messages sent through an
Addr
. - An address to a
Service
implementing any interface that takes a given message. - The request when sending an asynchronous message to a service.
- An error when sending a message to a service fails.
- Sends a message response from a service back to the waiting
Request
. - Shutdown request message sent by the
Controller
to subscribed services. - Notifies a service about an upcoming shutdown.
Enums§
- Determines how to shut down the Relay system.
Traits§
- Declares a message as part of an
Interface
. - A message interface for services.
- Response behavior of an
Interface
message. - An asynchronous unit responding to messages.
Functions§
- Creates an unbounded channel for communicating with a
Service
.