Skip to main content

Module background

Module background 

Source
Expand description

Single background job — the one-worker degenerate of the gatling pool.

For producer/consumer overlap (double-buffering), not fan-out: run one Send closure on a dedicated thread while the caller keeps producing, then Job::join for its result. The canonical use is a spill/sort/write stage that overlaps the next decode pass — one job in flight at a time (join the previous before spawning the next), so it is a depth-1 pipeline, not a pool.

This module is the sanctioned home for the raw std::thread::spawn that the one-engine “rayon-free” law forbids in every non-engine crate: callers get overlap by calling Job::spawn instead of hand-rolling a thread, so all threading in the constellation still originates in gatling. It deliberately owns no work-stealing, no shared cursor, no reader — for parallel fan-out use crate::gatling_forkjoin::gatling_for_each or the streaming crate::gatling::run engine instead.

Structs§

Job
A single closure running on its own thread. Create with Job::spawn, reap with Job::join. Dropping a Job without joining detaches the thread (the closure runs to completion but its result and any panic are lost) — the overlap pattern always joins, so prefer explicit Job::join.