MCPcopy Create free account
hub / github.com/Ridter/cf_workers_proxy / cancel

Function cancel

js/worker.js:253–263  ·  view source on GitHub ↗
(reason)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 2

logFunction · 0.85
safeCloseWebSocketFunction · 0.85

Tested by

no test coverage detected