Expand description
§Clone streams with clone-stream
Lazy single-threaded stream cloning: items are only cloned when a consumer actually polls for them.
The CloneStream struct implements Clone + Stream, allowing you
to create multiple concurrent consumers. The ForkStream trait provides
the entry point via the fork() method.
§How It Works
Unlike broadcast channels that eagerly clone every item for every subscriber, this crate clones on-demand. Items are delivered only to clones actively polling when items arrive (poll-time semantics).
§Important: Single-Threaded Runtime Required
This crate requires single-threaded async runtimes (current_thread flavor
or #[tokio::test]). The lazy semantics depend on cooperative scheduling;
multi-threaded runtimes cause race conditions.
Modules§
Structs§
- Clone
Stream - A cloneable stream that delivers items to consumers polling when items arrive.
- Fork
Config
Enums§
- Clone
Stream Error - Errors that can occur when working with cloned streams
Traits§
- Fork
Stream - Extension trait to make any
Streamcloneable.