import * as tsplus_module_1 from "@effect/core/stream/Stream/operations/fromChunkQueue";
import * as tsplus_module_2 from "@effect/core/stream/Stream/operations/ensuring";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/succeed";
import * as tsplus_module_4 from "@effect/core/stream/Stream/operations/flatMap";
/**
 * Creates a stream from a queue of values. The queue will be shutdown once
 * the stream is closed.
 *
 * @tsplus static ets/Stream/Ops fromChunkQueueWithShutdown
 */

export function fromChunkQueueWithShutdown(queue, __tsplusTrace) {
  return tsplus_module_4.flatMap_(tsplus_module_3.succeed(queue, __tsplusTrace), queue => tsplus_module_2.ensuring_(tsplus_module_1.fromChunkQueue(() => queue, __tsplusTrace), () => queue.shutdown, __tsplusTrace), __tsplusTrace);
}
//# sourceMappingURL=fromChunkQueueWithShutdown.mjs.map