Expand description
§Steady State Core - Easy Performant Async
Steady State is a high-performance, easy-to-use, actor-based framework for building concurrent applications in Rust. It provides a robust set of tools and utilities to guarantee your Service Level Agreements (SLAs) through comprehensive telemetry, alerts, and integration with Prometheus. Designed for low-latency, high-volume solutions, Steady State empowers developers to create scalable and resilient systems with ease.
§Key Features
- Actor Model: Simplifies concurrent programming by encapsulating state and behavior within actors.
- Telemetry and Monitoring: Built-in support for metrics collection, alerts, and Prometheus integration.
- Low Latency: Optimized for high-performance applications with minimal overhead.
- High Volume: Capable of handling large-scale data processing and communication.
§Getting Started
Add Steady State to your Cargo.toml
:
[dependencies]
steady_state = "0.1.0" # Replace with the actual version
Explore the documentation and examples in the repository for more details.
TODO: look for cargo all testing coverage.
Re-exports§
pub use actor_builder::CoreBalancer;
pub use state_management::SteadyState;
pub use state_management::new_state;
pub use state_management::new_persistent_state;
pub use state_management::StateGuard;
pub use crate::distributed::aqueduct_stream::StreamControlItem;
pub use steady_actor::SendOutcome;
pub use simulate_edge::SimRunner;
pub use graph_testing::GraphTestResult;
pub use monitor::RxMetaDataHolder;
pub use monitor::TxMetaDataHolder;
pub use channel_builder_units::Rate;
pub use channel_builder_units::Filled;
pub use actor_builder::Troupe;
pub use actor_builder::ScheduleAs;
pub use steady_rx::Rx;
pub use steady_tx::Tx;
pub use steady_rx::SteadyRxBundleTrait;
pub use steady_tx::SteadyTxBundleTrait;
pub use steady_rx::RxBundleTrait;
pub use steady_tx::TxBundleTrait;
pub use steady_rx::RxDone;
pub use steady_tx::TxDone;
pub use crate::distributed::aqueduct_builder::AqueductBuilder;
pub use steady_actor::SteadyActor;
pub use distributed::aeron_channel_structs::Channel;
pub use distributed::aeron_channel_structs::Endpoint;
pub use distributed::aeron_channel_structs::MediaType;
pub use distributed::aeron_channel_builder::AeronConfig;
pub use distributed::aeron_channel_builder::AqueTech;
pub use distributed::aqueduct_stream::StreamEgress;
pub use distributed::aqueduct_stream::StreamIngress;
pub use distributed::aqueduct_stream::LazySteadyStreamRxBundle;
pub use distributed::aqueduct_stream::LazySteadyStreamTxBundle;
pub use distributed::aqueduct_stream::SteadyStreamRxBundle;
pub use distributed::aqueduct_stream::SteadyStreamTxBundle;
pub use distributed::aqueduct_stream::LazyStreamRx;
pub use distributed::aqueduct_stream::LazyStreamTx;
pub use distributed::aqueduct_stream::SteadyStreamRxBundleTrait;
pub use distributed::aqueduct_stream::StreamRxBundleTrait;
pub use distributed::aqueduct_stream::SteadyStreamTxBundleTrait;
pub use distributed::aqueduct_stream::StreamTxBundleTrait;
pub use distributed::aqueduct_stream::LazySteadyStreamRxBundleClone;
pub use distributed::aqueduct_stream::LazySteadyStreamTxBundleClone;
pub use distributed::aqueduct_stream::SteadyStreamRx;
pub use distributed::aqueduct_stream::SteadyStreamTx;
pub use distributed::aqueduct_stream::StreamRx;
pub use distributed::aqueduct_stream::StreamTx;
pub use crate::expression_steady_eye::LAST_FALSE;
pub use steady_actor_spotlight::SteadyActorSpotlight;
pub use steady_actor_shadow::*;
pub use actor_builder::ScheduleAs::*;
pub use install::serviced::*;
pub use crate::logging_util::*;
Modules§
- actor_
builder - Actor construction, configuration, and scheduling utilities.
- builder
- Define
Command
line arguments - channel_
builder - Channel construction and configuration utilities.
- channel_
builder_ units - Telemetry details and unit structs for channels
- clap_
derive clap_derive
- distributed
- Components and builders for distributed systems.
- error
- Error reporting
- expression_
steady_ eye - Utilities for inspecting short boolean sequences.
- graph_
testing - Utilities for testing full graphs of actors.
- install
- This module contains submodules to support different installation strategies.
- logging_
util - Miscellaneous utility functions.
- monitor
- Monitoring utilities for inspecting channel and actor metrics at runtime.
- parser
Command
line argument parser- simulate_
edge - Tools for simulating edge cases in testing.
- state_
management - Manage state for actors scros failures and restarts
- steady_
actor - Commands and utilities for channels used by actors.
- steady_
actor_ shadow - Shadow utilities for steady actors.
- steady_
actor_ spotlight - Spotlight utilities for steady actors.
- steady_
rx - Receiver channel features and utilities.
- steady_
tx - Transmitter channel features and utilities.
- yield_
now - Utilities for yielding execution within actors.
Macros§
- arg
- Create an
Arg
from a usage string. - assert_
in_ logs - Asserts that the given sequence of texts appears in the captured logs in order.
- assert_
steady_ rx_ eq_ count - Asserts that the number of available units in the receiver equals the expected value.
- assert_
steady_ rx_ eq_ take - Asserts that values taken from the receiver match the expected sequence.
- assert_
steady_ rx_ gt_ count - Asserts that the number of available units in the receiver exceeds the expected value.
- await_
for_ all - Waits for all provided futures to complete, returning
true
only if all complete withtrue
. - await_
for_ all_ or_ proceed_ upon - Macro for “wait for all or proceed upon first” pattern.
- await_
for_ any - Waits for any of the provided futures to complete, returning the result of the first to finish.
- command
- Requires
cargo
feature flag to be enabled. - debug
- Logs a message at the debug level.
- error
- Logs a message at the error level.
- i
- Wraps a boolean expression and logs its identifier if it evaluates to
false
. - info
- Logs a message at the info level.
- into_
monitor - Macro for creating a LocalMonitor from channels.
- trace
- Logs a message at the trace level.
- value_
parser - Select a
ValueParser
implementation from the intended type - wait_
for_ all - Waits for all provided futures to complete, returning a future that resolves to
true
only if all complete withtrue
. - wait_
for_ any - Like
await_for_any!
, but returns a future instead of immediately awaiting it. - warn
- Logs a message at the warn level.
Structs§
- Actor
Identity - Identifies an actor within the graph uniquely.
- Actor
Name - Represents the name of an actor, including an optional suffix for uniqueness.
- Arg
- The abstract representation of a command line argument. Used to set all the options and relationships that define a valid argument for the program.
- ArgGroup
- Family of related arguments.
- ArgMatches
- Container for parse results.
- Command
- Build a command-line interface.
- Delay
- A future representing the notification that an elapsed duration has occurred.
- Duration
- A
Duration
type to represent a span of time, typically used for system timeouts. - Graph
- Represents the graph of actors and manages their execution and lifecycle.
- Graph
Builder - Configures and builds a
Graph
instance with customizable options. - Graph
Liveliness - Manages the liveliness state of the graph and coordinates the shutdown voting process.
- Id
Arg
orArgGroup
identifier- Instant
- A measurement of a monotonically nondecreasing clock.
Opaque and useful only with
Duration
. - Lazy
Steady Rx - Lazy wrapper for
SteadyRx<T>
, deferring channel allocation until first use. - Lazy
Steady Tx - Lazy wrapper for
SteadyTx<T>
, deferring channel allocation until first use. - MCPU
- Represents CPU usage in milli-CPUs (mCPU), used for performance analysis and monitoring.
- Percentile
- Represents a percentile value for statistical analysis in telemetry metrics.
- Shutdown
Vote - Represents a vote cast by an actor regarding the shutdown of the graph.
- Stage
Manager Guard - A guard that provides access to the stage manager for testing purposes.
- StdDev
- Represents a standard deviation value for metrics and alerts.
- Work
- Represents a unit of work as a percentage, used for workload analysis and monitoring.
Enums§
- Alert
Color - Represents the color of an alert.
- ArgAction
- Behavior of arguments when they are encountered while parsing
- Color
Choice - Represents the color preferences for program output
- Graph
Liveliness State - Represents the possible states of the graph’s liveliness within the SteadyState framework.
- LogLevel
- Logging levels for controlling verbosity of the crate’s logging output.
- Proactor
Config - Defines configuration options for the proactor, which manages I/O operations.
- Send
Saturation - Represents the behavior of the system when a channel is saturated (i.e., full).
- Trigger
- Represents a trigger condition for a metric.
- Value
Hint - Provide shell with hint on how to complete an argument.
Traits§
- Args
- Parse a set of arguments into a user-defined container.
- Command
Factory - Create a
Command
relevant for a user-defined container. - Compute
Metric - Trait for metrics suitable for computational actors.
- Data
Metric - Trait for metrics suitable for data channels.
- Double
Slice - Trait providing an interface for working with a pair of slices as a unified data source.
- Double
Slice Copy - Trait for copying data from a pair of slices into a single target slice.
- Error
Error
is a trait representing the basic expectations for error values, i.e., values of typeE
inResult<T, E>
.- From
ArgMatches - Converts an instance of
ArgMatches
to a user-defined container. - Future
- A future represents an asynchronous computation, commonly obtained by use of
async
. - Lazy
Steady RxBundle Clone - Trait for cloning lazy receiver bundles with initialization.
- Lazy
Steady TxBundle Clone - Trait for cloning lazy transmitter bundles with initialization.
- Metric
- Base trait for all metrics used in telemetry and Prometheus.
- Parser
- Parse command-line arguments into
Self
. - Quad
Slice - Trait for working with four slices representing two data types, typically items and payloads.
- RxCore
- Trait defining the core functionality for receiving data in a steady-state system.
- Stream
Quad Slice Copy - Trait for copying items and their payloads from four slices into target slices.
- Subcommand
- Parse a sub-command into a user-defined enum.
- TxCore
- Trait defining the core functionality for transmitting data in a steady-state system.
- Value
Enum - Parse arguments into enums.
Functions§
- init_
logging - Initializes logging for the Steady State crate.
- steady_
await_ for_ all_ or_ proceed_ upon_ five - Waits for either the first future to complete, or for all of the remaining five futures to complete.
- steady_
await_ for_ all_ or_ proceed_ upon_ four - Waits for either the first future to complete, or for all of the remaining four futures to complete.
- steady_
await_ for_ all_ or_ proceed_ upon_ three - Waits for either the first future to complete, or for all of the remaining three futures to complete.
- steady_
await_ for_ all_ or_ proceed_ upon_ two - Waits for either the first future to complete, or for all of the remaining futures to complete.
- steady_
fuse_ future - Utilities for managing concurrent execution of futures.
- steady_
rx_ bundle - Creates a bundle of thread-safe receivers with a fixed size, wrapped in an
Arc
. - steady_
select_ five - Waits for the first of five futures to complete, returning its result.
- steady_
select_ four - Waits for the first of four futures to complete, returning its result.
- steady_
select_ three - Waits for the first of three futures to complete, returning its result.
- steady_
select_ two - Waits for the first of two futures to complete, returning its result.
- steady_
tx_ bundle - Creates a bundle of thread-safe transmitters with a fixed size, wrapped in an
Arc
.
Type Aliases§
- Lazy
Steady RxBundle - Type alias for an array of lazy-initialized receivers with a fixed size.
- Lazy
Steady TxBundle - Type alias for an array of lazy-initialized transmitters with a fixed size.
- RxBundle
- Type alias for a vector of
MutexGuard
references to receivers. - RxCore
Bundle - Bundle of
RxCore
guards for batch locking of receivers. - Steady
Rx - Type alias for a thread-safe receiver wrapped in an
Arc
andMutex
. - Steady
RxBundle - Type alias for an array of thread-safe receivers with a fixed size, wrapped in an
Arc
. - Steady
Tx - Type alias for a thread-safe transmitter wrapped in an
Arc
andMutex
. - Steady
TxBundle - Type alias for an array of thread-safe transmitters with a fixed size, wrapped in an
Arc
. - TxBundle
- Type alias for a vector of
MutexGuard
references to transmitters. - TxCore
Bundle - Bundle of
TxCore
guards for batch locking of transmitters.
Derive Macros§
- Args
- Generates the
Args
impl. - Parser
- Generates the
Parser
implementation. - Subcommand
- Generates the
Subcommand
impl. - Value
Enum - Generates the
ValueEnum
impl.