(event: ExecutionEvent)
| 901 | } |
| 902 | |
| 903 | const writeCore = async (event: ExecutionEvent): Promise<ExecutionEventEntry> => { |
| 904 | if (nextEventId === 0 || nextEventId > maxReservedId) { |
| 905 | await reserveIds(1) |
| 906 | } |
| 907 | const eventId = nextEventId++ |
| 908 | const compactEvent = await compactEventForBuffer(event, { |
| 909 | ...context, |
| 910 | executionId, |
| 911 | requireDurablePayloads: true, |
| 912 | }) |
| 913 | const entry: ExecutionEventEntry = { eventId, executionId, event: compactEvent } |
| 914 | pending.push(entry) |
| 915 | if (pending.length >= FLUSH_MAX_BATCH) { |
| 916 | await flushPending() |
| 917 | } else { |
| 918 | scheduleFlush() |
| 919 | } |
| 920 | return entry |
| 921 | } |
| 922 | |
| 923 | const write = (event: ExecutionEvent): Promise<ExecutionEventEntry> => { |
| 924 | if (closed) return Promise.resolve({ eventId: 0, executionId, event }) |
no test coverage detected