/** * Converts the stream to a sliding scoped queue of chunks. After the scope is * closed, the queue will never again produce values and should be discarded. * * @tsplus static effect/core/stream/Stream.Aspects toQueueSliding * @tsplus pipeable effect/core/stream/Stream toQueueSliding */ export function toQueueSliding(capacity = 2) { return (self: Stream): Effect>> => Effect.acquireRelease( Queue.sliding>(capacity), (queue) => queue.shutdown ).tap((queue) => self.runIntoQueueScoped(queue).forkScoped) }