MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / pushEvent

Function pushEvent

runtime/worker/engine.js:261–273  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

259
260/* Push a string into the VM's event queue; wakes `receive()`. Buffers if the VM isn't paused on PENDING_EVENT yet, the driver loop drains the buffer at the next yield, so callers never need to know about the VM's readiness window. */
261export function pushEvent(message) {
262 const msg = String(message);
263 if (!injectEvent(msg)) {
264 pendingEvents.push(msg);
265 return true;
266 }
267 if (eventWaiter) {
268 const w = eventWaiter;
269 eventWaiter = null;
270 w();
271 }
272 return true;
273}
274
275/* Register the host-call delegate. worker.js wires a postMessage round-trip; no other consumer is supported. */
276export function setHostCallDelegate(fn) {

Callers

nothing calls this directly

Calls 2

injectEventFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected