(reason)
| 251 | // https://streams.spec.whatwg.org/#example-rs-push-backpressure |
| 252 | }, |
| 253 | cancel(reason) { |
| 254 | // 1. pipe WritableStream has error, this cancel will called, so ws handle server close into here |
| 255 | // 2. if readableStream is cancel, all controller.close/enqueue need skip, |
| 256 | // 3. but from testing controller.error still work even if readableStream is cancel |
| 257 | if (readableStreamCancel) { |
| 258 | return; |
| 259 | } |
| 260 | log(`ReadableStream was canceled, due to ${reason}`) |
| 261 | readableStreamCancel = true; |
| 262 | safeCloseWebSocket(webSocketServer); |
| 263 | } |
| 264 | }); |
| 265 | |
| 266 | return stream; |
nothing calls this directly
no test coverage detected