Skip to main content

emit_inbound

Function emit_inbound 

Source
pub fn emit_inbound(value: &CodeValue) -> bool
Expand description

Push a particle into the program, to be dispatched to its handlers the next time the host drains (between top-level statements).

Returns false when the host never called code_module_set_inbound — which happens whenever the module was loaded by something that does not support inbound emissions. Pushing is therefore always best-effort from the module’s side, and a module must stay correct when nobody is listening.

The particle is deep-copied into the host’s heap by the host’s own pusher, so value may be released as soon as this returns.

A pushed class the program has no handler for is a runtime error, not a silent drop (tests/fail_inbound_unhandled.code pins that). Push only what the program has agreed to receive.