Skip to main content

dispatch_stream_event

Function dispatch_stream_event 

Source
pub fn dispatch_stream_event(
    scope: &mut HandleScope<'_>,
    event_type: &str,
    payload: &[u8],
)
Expand description

Dispatch a stream event into V8 by calling the registered callback function.

Stream events are sent by the host when async operations (child processes, HTTP servers) produce data. The event_type determines which V8 dispatch function is called:

  • “child_stdout”, “child_stderr”, “child_exit” → _childProcessDispatch
  • “http_request” → _httpServerDispatch
  • “http2” → _http2Dispatch
  • “stdin”, “stdin_end” → _stdinDispatch
  • “net_socket” → _netSocketDispatch
  • “signal” → __secureExecWasmSignalDispatch or _signalDispatch
  • “timer” → _timerDispatch