Anyspawn
A generic task spawner compatible with any async runtime.
This crate provides a Spawner type that abstracts task spawning across
different async runtimes without generic infection.
Design Philosophy
- Concrete type: No generics needed in your code
- Simple: Use built-in constructors or provide a closure
- Flexible: Works with any async runtime
Quick Start
Using Tokio
use Spawner;
let spawner = new_tokio;
let result = spawner.spawn.await;
assert_eq!;
Custom Runtime
use Spawner;
let spawner = new_custom;
// Returns a JoinHandle that can be awaited or dropped
let handle = spawner.spawn;
Features
tokio(default): Enables theSpawner::new_tokioconstructorcustom: Enables theSpawner::new_customconstructor