Skip to main content

DaemonSpawner

Trait DaemonSpawner 

Source
pub trait DaemonSpawner: Send + Sync {
    // Required method
    fn spawn(&self, f: Box<dyn FnOnce() + Send + 'static>);
}
Expand description

Trait for custom thread/task executors to spawn the background Daemon.

Decouples std::thread::spawn from DualCacheFF::new, enabling execution on Tokio, FreeRTOS tasks, Loom virtual threads, or other user-defined runtimes.

Required Methods§

Source

fn spawn(&self, f: Box<dyn FnOnce() + Send + 'static>)

Spawn a closure as a concurrent background execution unit.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl DaemonSpawner for DefaultSpawner

Available on crate feature std only.