DenoDDeno
Powered by
abiA
Denoβ€’3y agoβ€’
1 reply
abi

Remove sink from stream

Is it at all possible to "undo" adding a sink on a stream? I am trying to make it so that once the writable stream fulfills some condition, it should stop reading from the readable.

someProcess.stderr.pipeTo(
  new WritableStream({
    write(chunk, controller) {
      if (someCondition()) {
        // how the heck do i "undo" this sink?
        // i want to stop processing here, and i don't care what
        // happens to stderr after this point.
      }
    },
  }),
);
someProcess.stderr.pipeTo(
  new WritableStream({
    write(chunk, controller) {
      if (someCondition()) {
        // how the heck do i "undo" this sink?
        // i want to stop processing here, and i don't care what
        // happens to stderr after this point.
      }
    },
  }),
);
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Remove Dependencies from `deno.lock` file
CJCCJ / help
3y ago
forward stream response from openapi to frontend
AbramAAbram / help
3y ago
Remove Old Deployments
jbakseJjbakse / help
3y ago