(input, flushFlag)
| 418 | |
| 419 | // Dispatch input to the threadpool and return a promise. |
| 420 | function processInputAsync(input, flushFlag) { |
| 421 | const { promise, resolve, reject } = PromiseWithResolvers(); |
| 422 | resolveWrite = resolve; |
| 423 | rejectWrite = reject; |
| 424 | writeInput = input; |
| 425 | writeFlush = flushFlag; |
| 426 | writeInOff = 0; |
| 427 | writeAvailIn = TypedArrayPrototypeGetByteLength(input); |
| 428 | writeAvailOutBefore = chunkSize - outOffset; |
| 429 | |
| 430 | // Keep input alive while the threadpool references it. |
| 431 | handle.buffer = input; |
| 432 | |
| 433 | handle.write(flushFlag, |
| 434 | input, 0, writeAvailIn, |
| 435 | outBuf, outOffset, writeAvailOutBefore); |
| 436 | return promise; |
| 437 | } |
| 438 | |
| 439 | function drainBatch() { |
| 440 | if (pendingBytes <= BATCH_HWM) { |
no test coverage detected
searching dependent graphs…