Futures monitoring
The future! macro and #[future_fn] attribute instrument any async function or piece of code or to track poll counts and future lifecycle:
#[tokio::main]
#[hotpath::main]
async fn main() {
// Instrument a future expression
let result = hotpath::future!(async { 42 }, log = true).await;
instrumented_fetch().await;
}
// Or use the attribute on async functions
#[hotpath::future_fn(log = true)]
async fn instrumented_fetch() -> Vec<u8> {
vec![1, 2, 3]
}
By passing log = true TUI will display values that future resolved to: