Expand description
Effect.ts-inspired Stream API.
Stream v2 adds a pull contract (poll_next_chunk) while preserving the existing facade.
Wave 7: the output side of any crate::coordination::channel::Channel<A, …, …, E, R> is
consumed as a stream of A with upstream/read failures crate::ChannelReadError via
Stream::from_channel / crate::coordination::channel::Channel::to_stream.
Duplex crate::coordination::channel::QueueChannel<A, A, _> uses Stream::from_duplex_queue_channel /
crate::coordination::channel::QueueChannel::to_stream with QueueError (call
crate::coordination::channel::QueueChannel::shutdown to end a drain). A dedicated
incremental StreamState arm is deferred while Stream stays generic over E without a
QueueError error channel.
Structs§
- Stream
- Pull-based async stream of
Awith error typeEand environmentR. - Stream
Channel Full - Error when
send_chunkcannot enqueue because the channel is full andBackpressurePolicy::Failis in effect. - Stream
Sender - Producer handle for a
Streambuilt withstream_from_channel/stream_from_channel_with_policy.
Enums§
- Backpressure
Decision - Concrete action chosen for one enqueue attempt given policy and fill level.
- Backpressure
Policy - How
stream_from_channel_with_policybehaves when the internal queue is full.
Functions§
- backpressure_
decision - Maps
(policy, queue_len, capacity)to aBackpressureDecision(capacity< 1treated as1). - end_
stream - Signals end-of-stream to consumers (blocks until accepted when using a blocking queue).
- merge_
time_ bucket - Update the bucket at
window_startwithf(Noneif the bucket did not exist yet). - send_
chunk - Enqueues a chunk for consumers; may block, drop, or fail per the sender’s policy.
- stream_
from_ channel stream_from_channel_with_policywithBackpressurePolicy::BoundedBlock.- stream_
from_ channel_ with_ policy - Builds a channel-backed stream and sender with explicit
BackpressurePolicy.
Type Aliases§
- Stream
Broadcast Fanout (consumer streams, pump effect)fromStream::broadcast.- Stream
V1 - Compatibility facade preserving the v1 public stream type name.
- Time
Bucket Map - Ordered window-start → aggregation state, for time-keyed stream operators (tumbling / sliding).