fluxion-exec
Async stream subscribers and execution utilities for fluxion.
Features
- Async Subscribers: Execute async handlers for each stream item
- Cancellation Support: Built-in cancellation token support
- Error Handling: Customizable error callbacks
- Execution Strategies: Sequential and parallel processing modes
Subscribers
subscribe_async
Sequential processing of stream items with async handlers. Returns Result<()>.
use SubscribeAsyncExt;
use StreamExt;
stream
.subscribe_async
.await?;
subscribe_latest_async
Parallel processing with automatic cancellation of outdated work. Returns Result<()>.
use SubscribeLatestAsyncExt;
stream
.subscribe_latest_async
.await?;
Use Cases
- Processing stream events with async I/O
- Database operations triggered by stream events
- API calls based on stream data
- Background task execution with cancellation
License
Apache-2.0