anyspawn 0.5.3

A generic task spawner compatible with any async runtime.
Documentation

Anyspawn

crate.io docs.rs MSRV CI Coverage License

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 implement SpawnCustom
  • Layered: Compose middleware closures via CustomSpawnerBuilder
  • Flexible: Works with any async runtime

Quick Start

Using Tokio

use anyspawn::Spawner;

let spawner = Spawner::new_tokio();
let result = spawner.spawn(async { 1 + 1 }).await;
assert_eq!(result, 2);

Thread-Aware Support

Spawner implements ThreadAware and supports per-core isolation via custom SpawnCustom implementations, enabling contention-free, NUMA-friendly task dispatch.

Features