pub fn drain_fetch_commands(
events: MessageReader<'_, '_, ScriptCommandEvent>,
fetcher: Res<'_, FetchRegistry>,
hooks: Option<Res<'_, HttpHooks>>,
waker: Option<Res<'_, EventLoopWaker>>,
)Expand description
Read Fetch / Http commands the script emitted this tick and hand each
to the registry’s dispatcher. Other variants are no-ops here (they
flow to apply_script_commands and timer drains separately).
Each reply wakes the event loop once it is queued, so an app that went idle while the request was in flight runs the tick that delivers it. The waker is optional so a bare test can drive this without a loop to wake.