import { channel } from "https://deno.land/x/streamtools@v1.0.0/channel.ts";
Creates a new channel, which is a pair of a readable and writable stream.
import { channel } from "./channel.ts";
import { push } from "./push.ts";
import { pop } from "./pop.ts";
const { reader, writer } = channel<number>();
await push(writer, 1);
await push(writer, 2);
await push(writer, 3);
console.log(await pop(reader)); // 1
console.log(await pop(reader)); // 2
console.log(await pop(reader)); // 3