// ets_tracing: off
import * as T from "../../../../Effect";
import { pipe } from "../../../../Function";
import * as M from "../../../../Managed";
import * as Q from "../../../../Queue";
import * as RunIntoManaged from "./runIntoManaged";
/**
 * Converts the stream into an unbounded managed queue. After the managed queue
 * is used, the queue will never again produce values and should be discarded.
 */

export function toQueueUnbounded(self) {
  return M.map_(M.tap_(M.bind_(M.do, "queue", () => T.toManagedRelease_(Q.makeUnbounded(), Q.shutdown)), ({
    queue
  }) => M.fork(RunIntoManaged.runIntoManaged_(self, queue))), ({
    queue
  }) => queue);
}
//# sourceMappingURL=toQueueUnbounded.js.map