(request: Request, destination: Destination)
| 6255 | } |
| 6256 | |
| 6257 | export function startFlowing(request: Request, destination: Destination): void { |
| 6258 | if (request.status === CLOSING) { |
| 6259 | request.status = CLOSED; |
| 6260 | closeWithError(destination, request.fatalError); |
| 6261 | return; |
| 6262 | } |
| 6263 | if (request.status === CLOSED) { |
| 6264 | return; |
| 6265 | } |
| 6266 | if (request.destination !== null) { |
| 6267 | // We're already flowing. |
| 6268 | return; |
| 6269 | } |
| 6270 | request.destination = destination; |
| 6271 | |
| 6272 | try { |
| 6273 | flushCompletedQueues(request, destination); |
| 6274 | } catch (error) { |
| 6275 | const errorInfo: ThrownInfo = {}; |
| 6276 | logRecoverableError(request, error, errorInfo, null); |
| 6277 | fatalError(request, error, errorInfo, null); |
| 6278 | } |
| 6279 | } |
| 6280 | |
| 6281 | export function stopFlowing(request: Request): void { |
| 6282 | request.destination = null; |
no test coverage detected