MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / pollEvents

Function pollEvents

packages/node/src/backend/nodeBackendInline.ts:752–766  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

750 },
751
752 pollEvents(): Promise<BackendEventBatch> {
753 if (disposed) return Promise.reject(new Error("NodeBackend(inline): disposed"));
754 if (fatal !== null) return Promise.reject(fatal);
755 if (stopRequested) return Promise.reject(new Error("NodeBackend(inline): stopped"));
756
757 const queued = eventQueue.shift();
758 if (queued !== undefined) {
759 return Promise.resolve(buildBatch(queued.batch, queued.byteLen, queued.droppedSinceLast));
760 }
761
762 const d = deferred<BackendEventBatch>();
763 eventWaiters.push(d);
764 schedulePoll(POLL_BUSY_MS);
765 return d.promise;
766 },
767
768 postUserEvent(tag: number, payload: Uint8Array): void {
769 if (disposed) throw new Error("NodeBackend(inline): disposed");

Callers

nothing calls this directly

Calls 5

buildBatchFunction · 0.85
schedulePollFunction · 0.85
resolveMethod · 0.80
deferredFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected