net-lattice-async
Runtime-independent asynchronous event-stream adapter for Net Lattice.
What it provides
EventStream<E>, afutures::Stream<Item = Result<E>>surface;- adaptation of blocking
EventReceivertransports using one worker thread; - direct wrapping of backend-native Tokio receivers;
- deterministic shutdown when the stream is dropped.
Applications normally enable the async feature on net-lattice and obtain
the stream from its facade. Depend on this crate directly only when adapting a
custom backend transport.
Usage
use StreamExt;
use ;
async
Runtime behavior
The adapter does not select an async runtime. A blocking receiver uses a
dedicated worker because std::sync::mpsc::Receiver cannot register a waker;
a native Tokio receiver is exposed without that worker.