(request: Request)
| 6211 | } |
| 6212 | |
| 6213 | function enqueueFlush(request: Request): void { |
| 6214 | if ( |
| 6215 | request.flushScheduled === false && |
| 6216 | // If there are pinged tasks we are going to flush anyway after work completes |
| 6217 | request.pingedTasks.length === 0 && |
| 6218 | // If there is no destination there is nothing we can flush to. A flush will |
| 6219 | // happen when we start flowing again |
| 6220 | request.destination !== null |
| 6221 | ) { |
| 6222 | request.flushScheduled = true; |
| 6223 | scheduleWork(() => { |
| 6224 | // We need to existence check destination again here because it might go away |
| 6225 | // in between the enqueueFlush call and the work execution |
| 6226 | const destination = request.destination; |
| 6227 | if (destination) { |
| 6228 | flushCompletedQueues(request, destination); |
| 6229 | } else { |
| 6230 | request.flushScheduled = false; |
| 6231 | } |
| 6232 | }); |
| 6233 | } |
| 6234 | } |
| 6235 | |
| 6236 | // This function is intented to only be called during the pipe function for the Node builds. |
| 6237 | // The reason we need this is because `renderToPipeableStream` is the only API which allows |
no test coverage detected