()
| 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"); |
nothing calls this directly
no test coverage detected