pub async fn worker(
errors: Sender<RuntimeError>,
events: Sender<Event>
) -> Result<(), CriticalError>
Expand description
Launch the signal event worker.
While you can run several, you must only have one. This may be enforced later.
Examples
Direct usage:
use tokio::sync::mpsc;
use watchexec::signal::source::worker;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let (ev_s, _) = mpsc::channel(1024);
let (er_s, _) = mpsc::channel(64);
worker(er_s, ev_s).await?;
Ok(())
}