/** * 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 toQueueDropping * @tsplus pipeable effect/core/stream/Stream toQueueDropping */ export function toQueueDropping(capacity = 2) { return (self: Stream): Effect>> => Effect.acquireRelease( Queue.dropping>(capacity), (queue) => queue.shutdown ).tap((queue) => self.runIntoQueueScoped(queue).forkScoped) }