Skip to main content

dispatch

Function dispatch 

Source
pub fn dispatch(
    commands: Commands<'_, '_>,
    policy: Res<'_, Policy>,
    wake: Res<'_, Wake>,
    index: Res<'_, HandlerIndex>,
    registry: Registry<'_>,
    tasks: Tasks<'_>,
    serves: Query<'_, '_, &Serves>,
    served_by: Query<'_, '_, &ServedBy>,
    pending: Query<'_, '_, CandidateView, Candidate>,
    in_flight: Query<'_, '_, &InFlight>,
    parents: Query<'_, '_, &ChildOf>,
    issued: Query<'_, '_, &Issued>,
    scopes: Query<'_, '_, &Scope>,
    recording: Option<Res<'_, Recording>>,
    witnessing: DispatchWitness<'_, '_>,
    ids: ResMut<'_, IdCounter>,
)
Expand description

Dispatch eligible effects in Seq order up to the serving policy’s intake bound. Busy serial keys wait; reentrant effects, missing handlers, and exhausted IDs receive errors without opening records.

Accepted effects use reserved or fresh IDs and inherit the nearest issued parent and scope. Task-served effects own their execution; world-served effects await system answers. Tool inputs and publication slots travel beside requests.