(entry: {done: boolean, value: ReactClientValue, ...})
| 1128 | request.completedRegularChunks.push(stringToChunk(startStreamRow)); |
| 1129 | |
| 1130 | function progress(entry: {done: boolean, value: ReactClientValue, ...}) { |
| 1131 | if (streamTask.status !== PENDING) { |
| 1132 | return; |
| 1133 | } |
| 1134 | |
| 1135 | if (entry.done) { |
| 1136 | streamTask.status = COMPLETED; |
| 1137 | const endStreamRow = streamTask.id.toString(16) + ':C\n'; |
| 1138 | request.completedRegularChunks.push(stringToChunk(endStreamRow)); |
| 1139 | request.abortableTasks.delete(streamTask); |
| 1140 | request.cacheController.signal.removeEventListener('abort', abortStream); |
| 1141 | enqueueFlush(request); |
| 1142 | callOnAllReadyIfReady(request); |
| 1143 | } else { |
| 1144 | try { |
| 1145 | streamTask.model = entry.value; |
| 1146 | request.pendingChunks++; |
| 1147 | tryStreamTask(request, streamTask); |
| 1148 | enqueueFlush(request); |
| 1149 | reader.read().then(progress, error); |
| 1150 | } catch (x) { |
| 1151 | error(x); |
| 1152 | } |
| 1153 | } |
| 1154 | } |
| 1155 | function error(reason: mixed) { |
| 1156 | if (streamTask.status !== PENDING) { |
| 1157 | return; |
nothing calls this directly
no test coverage detected