Streams monitoring
hotpath::stream! macro
This macro instruments async streams to track items yielded:
use futures::stream::{self, StreamExt};
#[tokio::main]
#[hotpath::main]
async fn main() {
// Create and instrument a stream in one step
let s = hotpath::stream!(stream::iter(1..=100));
// Use it normally
let items: Vec<_> = s.collect().await;
}
Optional config
// Custom label
let s = hotpath::stream!(stream::iter(1..=100), label = "data_stream");
// Enable item logging (requires std::fmt::Debug trait on item type)
let s = hotpath::stream!(stream::iter(1..=100), log = true);
Label streams to display them on top of the list. By passing log = true TUI will display values that a stream yielded.