@effect-ts/system
Version:
Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.
26 lines (24 loc) • 1.01 kB
JavaScript
// ets_tracing: off
import * as Q from "../../../../Queue/index.mjs";
import * as C from "../core.mjs";
import * as Ensuring from "./ensuring.mjs";
import * as FromQueue from "./fromQueue.mjs";
/**
* Creates a stream from a queue of values. The queue will be shutdown once the stream is closed.
*
* @param maxChunkSize Maximum number of queued elements to put in one chunk in the stream
*/
export function fromQueueWithShutdown_(queue, maxChunkSize = C.DEFAULT_CHUNK_SIZE) {
return Ensuring.ensuring_(FromQueue.fromQueue_(queue, maxChunkSize), Q.shutdown(queue));
}
/**
* Creates a stream from a queue of values. The queue will be shutdown once the stream is closed.
*
* @param maxChunkSize Maximum number of queued elements to put in one chunk in the stream
*
* @ets_data_first fromQueueWithShutdown_
*/
export function fromQueueWithShutdown(maxChunkSize = C.DEFAULT_CHUNK_SIZE) {
return queue => fromQueueWithShutdown_(queue, maxChunkSize);
}
//# sourceMappingURL=fromQueueWithShutdown.mjs.map