Skip to main content

Module job

Module job 

Source
Expand description

Jobs, the work handed to another world. Jobs: work handed to another world.

A Job is a boxed closure the target world runs on its own thread. The sender never waits for it: a queue that is full or stopped reports SendError and the job comes back.

A job never answers back directly. What one world learns from another is state, and state travels the other way: a subscription publishes it, and the caller reads it on its own tick. A caller that needs the value one job produces asks for it under a key — Pending sends the job, remembers the key, and answers on the caller’s next tick — or publishes that value itself, through the snapshot its subscription fills.

Re-exports§

use unlit_ecs::World; 🔒

Structs§

JobSender
A cloneable handle to a world’s job queue.

Enums§

SendError
Why a job was not handed to a world.

Type Aliases§

Job
A unit of work for a world: a boxed closure that runs against it.