EventQueue
Class representing instance of Event Queue
Methods
waitEvent
Waits until the next event is available and returns it (long-poll; the promise stays pending indefinitely while no event arrives). Delegates to the WASM core's blocking event queue, which is fed by the Bridge server over the connection's event channel. Concurrent callers share one pending wait: all of them receive the same next event, and a new wait starts only after it resolves. Call in a loop to drive event handling, after subscribing via the relevant API's subscribeFor. To make a pending waitEvent return without a real server event (e.g. to stop the loop), call emitBreakEvent.
Returns
Promise<Event> ·
the next event; inspect event.type / event.channel to route it. A break event injected by emitBreakEvent has type "libBreak".
emitBreakEvent
Injects an artificial "libBreak" event into the queue, causing the pending (or next) waitEvent to resolve with it. The event is generated locally in the WASM core - nothing is sent to the server. Use it to wake up and terminate an event-processing loop gracefully (it ends a for await (… of queue) loop), e.g. before Connection.disconnect.
We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.