Crate steady_state

Source
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 with true.
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 with true.
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§

ActorIdentity
Identifies an actor within the graph uniquely.
ActorName
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.
GraphBuilder
Configures and builds a Graph instance with customizable options.
GraphLiveliness
Manages the liveliness state of the graph and coordinates the shutdown voting process.
Id
Arg or ArgGroup identifier
Instant
A measurement of a monotonically nondecreasing clock. Opaque and useful only with Duration.
LazySteadyRx
Lazy wrapper for SteadyRx<T>, deferring channel allocation until first use.
LazySteadyTx
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.
ShutdownVote
Represents a vote cast by an actor regarding the shutdown of the graph.
StageManagerGuard
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§

AlertColor
Represents the color of an alert.
ArgAction
Behavior of arguments when they are encountered while parsing
ColorChoice
Represents the color preferences for program output
GraphLivelinessState
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.
ProactorConfig
Defines configuration options for the proactor, which manages I/O operations.
SendSaturation
Represents the behavior of the system when a channel is saturated (i.e., full).
Trigger
Represents a trigger condition for a metric.
ValueHint
Provide shell with hint on how to complete an argument.

Traits§

Args
Parse a set of arguments into a user-defined container.
CommandFactory
Create a Command relevant for a user-defined container.
ComputeMetric
Trait for metrics suitable for computational actors.
DataMetric
Trait for metrics suitable for data channels.
DoubleSlice
Trait providing an interface for working with a pair of slices as a unified data source.
DoubleSliceCopy
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 type E in Result<T, E>.
FromArgMatches
Converts an instance of ArgMatches to a user-defined container.
Future
A future represents an asynchronous computation, commonly obtained by use of async.
LazySteadyRxBundleClone
Trait for cloning lazy receiver bundles with initialization.
LazySteadyTxBundleClone
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.
QuadSlice
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.
StreamQuadSliceCopy
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.
ValueEnum
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§

LazySteadyRxBundle
Type alias for an array of lazy-initialized receivers with a fixed size.
LazySteadyTxBundle
Type alias for an array of lazy-initialized transmitters with a fixed size.
RxBundle
Type alias for a vector of MutexGuard references to receivers.
RxCoreBundle
Bundle of RxCore guards for batch locking of receivers.
SteadyRx
Type alias for a thread-safe receiver wrapped in an Arc and Mutex.
SteadyRxBundle
Type alias for an array of thread-safe receivers with a fixed size, wrapped in an Arc.
SteadyTx
Type alias for a thread-safe transmitter wrapped in an Arc and Mutex.
SteadyTxBundle
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.
TxCoreBundle
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.
ValueEnum
Generates the ValueEnum impl.