| 5748 | } |
| 5749 | |
| 5750 | function tryStreamTask(request: Request, task: Task): void { |
| 5751 | // This is used to try to emit something synchronously but if it suspends, |
| 5752 | // we emit a reference to a new outlined task immediately instead. |
| 5753 | const prevCanEmitDebugInfo = canEmitDebugInfo; |
| 5754 | if (__DEV__) { |
| 5755 | // We can't emit debug into to a specific row of a stream task. Instead we leave |
| 5756 | // it false so that we instead outline the row to get a new canEmitDebugInfo if needed. |
| 5757 | canEmitDebugInfo = false; |
| 5758 | } |
| 5759 | const parentSerializedSize = serializedSize; |
| 5760 | try { |
| 5761 | emitChunk(request, task, task.model); |
| 5762 | } finally { |
| 5763 | serializedSize = parentSerializedSize; |
| 5764 | if (__DEV__) { |
| 5765 | canEmitDebugInfo = prevCanEmitDebugInfo; |
| 5766 | } |
| 5767 | } |
| 5768 | } |
| 5769 | |
| 5770 | function performWork(request: Request): void { |
| 5771 | markAsyncSequenceRootTask(); |