Skip to main content

datum/dynamic/
mod.rs

1//! Dynamic stream controls and attachment points modeled after Akka Streams.
2//!
3//! `KillSwitches` expose reusable shutdown/abort controls for already-wired streams without
4//! starting any work before materialization.
5//!
6//! The hub stages materialize reusable attachment points:
7//! - `MergeHub` materializes a `Sink` that many producers can attach to over time.
8//! - `BroadcastHub` materializes a `Source` that many consumers can attach to over time.
9//! - `PartitionHub` materializes a `Source` whose elements are routed to one selected consumer.
10//!
11//! `BroadcastHub` and `PartitionHub` follow Akka's caveat that one upstream producer adapts to the
12//! slowest active consumer unless callers add their own buffering or drop stages around the
13//! materialized consumer sources.
14//!
15//! Datum's `BroadcastHub` differs from Akka when there are zero attached consumers: Datum blocks
16//! upstream immediately, while Akka may pre-buffer up to `buffer_size` elements before stalling.
17
18mod hub;
19mod kill_switch;
20
21pub use hub::{
22    BroadcastHub, BroadcastHubConsumerSource, MergeHub, MergeHubDrainingControl,
23    PartitionConsumerInfo, PartitionHub, PartitionHubConsumerSource,
24};
25pub use kill_switch::{KillSwitches, SharedKillSwitch, UniqueKillSwitch};