Skip to main content

make_inbound_raw

Function make_inbound_raw 

Source
pub fn make_inbound_raw<T>(
    wake: Arc<Notify>,
) -> (InboundBus<T>, UnboundedReceiver<T>)
where T: Send + 'static,
Expand description

Build a host-drained inbound primitive: the wake-baked InboundBus sender PLUS the raw receiver, with NO per-tick handler.

Use this (instead of make_inbound) when the per-item work needs mutable host state a FnMut(T) -> Vec<Effect> handler closure can’t capture — e.g. LSP workspace/applyEdit, whose apply is irreducibly &mut Editor and carries lsp_types that can’t cross the [Effect] boundary. The caller holds the receiver and drains it from its own tick (with whatever &mut access it needs); the wake still fires on every InboundBus::send, so the work is answered off-keystroke (paramount #4 — the wake lives in the sender, so it can’t be forgotten), exactly like make_inbound. Keeping the drain host-side this way avoids introducing an internal-pump variant into the [Effect] vocabulary.