// ets_tracing: off
import * as C from "../../Cause";
import * as Q from "../../Queue";
import * as T from "../_internal/effect";
import * as Pull from "../Pull";
import { repeatEffectChunkOption } from "./repeatEffectChunkOption";
/**
 * Creates a stream from a {@link XQueue} of values
 */

export function fromChunkQueue(queue) {
  return repeatEffectChunkOption(T.catchAllCause_(Q.take(queue), c => T.chain_(Q.isShutdown(queue), down => down && C.interrupted(c) ? Pull.end : Pull.halt(c))));
}
//# sourceMappingURL=fromChunkQueue.js.map