fastn-context
Type-safe async context propagation for Rust applications.
Overview
fastn-context
provides a clean, efficient way to manage async operation context and cancellation in Rust applications. It's designed for applications that need to track operation status, handle graceful shutdowns, and manage background tasks.
Features
- Type-safe context management with structured data
- Graceful cancellation using tokio's CancellationToken
- Operation tracking with status and metrics
- Minimal overhead - zero-cost when not used
- Easy integration with existing async code
Quick Start
Add to your Cargo.toml
:
[]
= "0.1"
Basic Usage
use Context;
async
With Custom Context
use ;
async
Documentation
Use Cases
- Web servers - Request context and graceful shutdown
- Background services - Task coordination and cancellation
- CLI tools - Operation status and signal handling
- Distributed systems - Operation tracking and coordination
License
Licensed under the Universal Permissive License (UPL-1.0).
Contributing
Contributions welcome! Please open an issue to discuss major changes before submitting a PR.