effect 2.3.8 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BigInt.js +14 -1
- package/dist/cjs/BigInt.js.map +1 -1
- package/dist/cjs/Effect.js +16 -61
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Either.js +35 -6
- package/dist/cjs/Either.js.map +1 -1
- package/dist/cjs/Equal.js +1 -1
- package/dist/cjs/Equal.js.map +1 -1
- package/dist/cjs/Exit.js +1 -1
- package/dist/cjs/Number.js +25 -1
- package/dist/cjs/Number.js.map +1 -1
- package/dist/cjs/ReadonlyArray.js +2 -2
- package/dist/cjs/ReadonlyArray.js.map +1 -1
- package/dist/cjs/ReadonlyRecord.js +71 -76
- package/dist/cjs/ReadonlyRecord.js.map +1 -1
- package/dist/cjs/STM.js.map +1 -1
- package/dist/cjs/Schedule.js.map +1 -1
- package/dist/cjs/Sink.js.map +1 -1
- package/dist/cjs/Stream.js +3 -23
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/Struct.js +3 -1
- package/dist/cjs/Struct.js.map +1 -1
- package/dist/cjs/TestAnnotation.js.map +1 -1
- package/dist/cjs/internal/channel/channelExecutor.js +5 -5
- package/dist/cjs/internal/channel/channelExecutor.js.map +1 -1
- package/dist/cjs/internal/channel/channelState.js +5 -5
- package/dist/cjs/internal/channel/channelState.js.map +1 -1
- package/dist/cjs/internal/channel.js.map +1 -1
- package/dist/cjs/internal/clock.js +3 -4
- package/dist/cjs/internal/clock.js.map +1 -1
- package/dist/cjs/internal/core-effect.js +6 -23
- package/dist/cjs/internal/core-effect.js.map +1 -1
- package/dist/cjs/internal/core.js +11 -27
- package/dist/cjs/internal/core.js.map +1 -1
- package/dist/cjs/internal/effect/circular.js +4 -5
- package/dist/cjs/internal/effect/circular.js.map +1 -1
- package/dist/cjs/internal/either.js +3 -3
- package/dist/cjs/internal/either.js.map +1 -1
- package/dist/cjs/internal/groupBy.js.map +1 -1
- package/dist/cjs/internal/layer.js +0 -2
- package/dist/cjs/internal/layer.js.map +1 -1
- package/dist/cjs/internal/runtime.js +12 -1
- package/dist/cjs/internal/runtime.js.map +1 -1
- package/dist/cjs/internal/schedule.js +4 -4
- package/dist/cjs/internal/schedule.js.map +1 -1
- package/dist/cjs/internal/sink.js +0 -2
- package/dist/cjs/internal/sink.js.map +1 -1
- package/dist/cjs/internal/stm/stm.js +1 -0
- package/dist/cjs/internal/stm/stm.js.map +1 -1
- package/dist/cjs/internal/stream.js +51 -64
- package/dist/cjs/internal/stream.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/BigInt.d.ts +7 -0
- package/dist/dts/BigInt.d.ts.map +1 -1
- package/dist/dts/Brand.d.ts +1 -1
- package/dist/dts/Brand.d.ts.map +1 -1
- package/dist/dts/Cause.d.ts +1 -1
- package/dist/dts/Cause.d.ts.map +1 -1
- package/dist/dts/Channel.d.ts +11 -11
- package/dist/dts/Channel.d.ts.map +1 -1
- package/dist/dts/Chunk.d.ts +3 -3
- package/dist/dts/Config.d.ts +4 -4
- package/dist/dts/Config.d.ts.map +1 -1
- package/dist/dts/Cron.d.ts +1 -1
- package/dist/dts/Cron.d.ts.map +1 -1
- package/dist/dts/Differ.d.ts +2 -2
- package/dist/dts/Differ.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts +52 -108
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Either.d.ts +126 -83
- package/dist/dts/Either.d.ts.map +1 -1
- package/dist/dts/Encoding.d.ts +6 -6
- package/dist/dts/Encoding.d.ts.map +1 -1
- package/dist/dts/Equal.d.ts.map +1 -1
- package/dist/dts/Exit.d.ts +2 -2
- package/dist/dts/Fiber.d.ts +2 -2
- package/dist/dts/Fiber.d.ts.map +1 -1
- package/dist/dts/GroupBy.d.ts +12 -12
- package/dist/dts/GroupBy.d.ts.map +1 -1
- package/dist/dts/Layer.d.ts +26 -26
- package/dist/dts/Layer.d.ts.map +1 -1
- package/dist/dts/List.d.ts +2 -2
- package/dist/dts/Logger.d.ts +4 -4
- package/dist/dts/Match.d.ts +2 -2
- package/dist/dts/Match.d.ts.map +1 -1
- package/dist/dts/MergeDecision.d.ts +1 -1
- package/dist/dts/MergeState.d.ts +5 -5
- package/dist/dts/MergeState.d.ts.map +1 -1
- package/dist/dts/Metric.d.ts +13 -13
- package/dist/dts/Metric.d.ts.map +1 -1
- package/dist/dts/MetricPolling.d.ts +4 -4
- package/dist/dts/MetricPolling.d.ts.map +1 -1
- package/dist/dts/Number.d.ts +8 -0
- package/dist/dts/Number.d.ts.map +1 -1
- package/dist/dts/Option.d.ts +11 -11
- package/dist/dts/ReadonlyArray.d.ts +9 -8
- package/dist/dts/ReadonlyArray.d.ts.map +1 -1
- package/dist/dts/ReadonlyRecord.d.ts +111 -94
- package/dist/dts/ReadonlyRecord.d.ts.map +1 -1
- package/dist/dts/Reloadable.d.ts +4 -4
- package/dist/dts/Reloadable.d.ts.map +1 -1
- package/dist/dts/RequestResolver.d.ts +13 -13
- package/dist/dts/RequestResolver.d.ts.map +1 -1
- package/dist/dts/Resource.d.ts +1 -1
- package/dist/dts/Resource.d.ts.map +1 -1
- package/dist/dts/STM.d.ts +144 -139
- package/dist/dts/STM.d.ts.map +1 -1
- package/dist/dts/Schedule.d.ts +171 -179
- package/dist/dts/Schedule.d.ts.map +1 -1
- package/dist/dts/SingleProducerAsyncInput.d.ts +1 -1
- package/dist/dts/SingleProducerAsyncInput.d.ts.map +1 -1
- package/dist/dts/Sink.d.ts +13 -13
- package/dist/dts/Sink.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +355 -366
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/Struct.d.ts +3 -3
- package/dist/dts/Struct.d.ts.map +1 -1
- package/dist/dts/SubscriptionRef.d.ts +2 -2
- package/dist/dts/TArray.d.ts +2 -2
- package/dist/dts/TDeferred.d.ts +3 -3
- package/dist/dts/TMap.d.ts +10 -10
- package/dist/dts/TSet.d.ts +4 -4
- package/dist/dts/Take.d.ts +2 -2
- package/dist/dts/TestAnnotation.d.ts +2 -2
- package/dist/dts/TestAnnotation.d.ts.map +1 -1
- package/dist/dts/Types.d.ts +7 -0
- package/dist/dts/Types.d.ts.map +1 -1
- package/dist/dts/internal/stm/stm.d.ts +2 -15
- package/dist/dts/internal/stm/stm.d.ts.map +1 -1
- package/dist/esm/BigInt.js +12 -0
- package/dist/esm/BigInt.js.map +1 -1
- package/dist/esm/Effect.js +13 -58
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Either.js +42 -5
- package/dist/esm/Either.js.map +1 -1
- package/dist/esm/Equal.js +1 -1
- package/dist/esm/Equal.js.map +1 -1
- package/dist/esm/Exit.js +1 -1
- package/dist/esm/Number.js +23 -0
- package/dist/esm/Number.js.map +1 -1
- package/dist/esm/ReadonlyArray.js +2 -2
- package/dist/esm/ReadonlyArray.js.map +1 -1
- package/dist/esm/ReadonlyRecord.js +70 -75
- package/dist/esm/ReadonlyRecord.js.map +1 -1
- package/dist/esm/STM.js.map +1 -1
- package/dist/esm/Schedule.js.map +1 -1
- package/dist/esm/Sink.js.map +1 -1
- package/dist/esm/Stream.js +5 -22
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/Struct.js +3 -1
- package/dist/esm/Struct.js.map +1 -1
- package/dist/esm/TestAnnotation.js.map +1 -1
- package/dist/esm/internal/channel/channelExecutor.js +5 -5
- package/dist/esm/internal/channel/channelExecutor.js.map +1 -1
- package/dist/esm/internal/channel/channelState.js +3 -3
- package/dist/esm/internal/channel/channelState.js.map +1 -1
- package/dist/esm/internal/channel.js.map +1 -1
- package/dist/esm/internal/clock.js +3 -4
- package/dist/esm/internal/clock.js.map +1 -1
- package/dist/esm/internal/core-effect.js +4 -20
- package/dist/esm/internal/core-effect.js.map +1 -1
- package/dist/esm/internal/core.js +8 -22
- package/dist/esm/internal/core.js.map +1 -1
- package/dist/esm/internal/effect/circular.js +4 -5
- package/dist/esm/internal/effect/circular.js.map +1 -1
- package/dist/esm/internal/either.js +3 -3
- package/dist/esm/internal/either.js.map +1 -1
- package/dist/esm/internal/groupBy.js.map +1 -1
- package/dist/esm/internal/layer.js +0 -2
- package/dist/esm/internal/layer.js.map +1 -1
- package/dist/esm/internal/runtime.js +12 -1
- package/dist/esm/internal/runtime.js.map +1 -1
- package/dist/esm/internal/schedule.js +4 -4
- package/dist/esm/internal/schedule.js.map +1 -1
- package/dist/esm/internal/sink.js +0 -2
- package/dist/esm/internal/sink.js.map +1 -1
- package/dist/esm/internal/stm/stm.js +1 -0
- package/dist/esm/internal/stm/stm.js.map +1 -1
- package/dist/esm/internal/stream.js +49 -59
- package/dist/esm/internal/stream.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/BigInt.ts +13 -0
- package/src/Brand.ts +4 -4
- package/src/Cause.ts +1 -1
- package/src/Channel.ts +17 -17
- package/src/Chunk.ts +4 -4
- package/src/Config.ts +4 -4
- package/src/Cron.ts +2 -2
- package/src/Differ.ts +2 -2
- package/src/Effect.ts +68 -145
- package/src/Either.ts +215 -133
- package/src/Encoding.ts +3 -3
- package/src/Equal.ts +1 -1
- package/src/Exit.ts +2 -2
- package/src/Fiber.ts +2 -2
- package/src/GroupBy.ts +16 -16
- package/src/Layer.ts +32 -32
- package/src/List.ts +3 -3
- package/src/Logger.ts +4 -4
- package/src/Match.ts +3 -3
- package/src/MergeDecision.ts +1 -1
- package/src/MergeState.ts +8 -8
- package/src/Metric.ts +13 -13
- package/src/MetricPolling.ts +9 -9
- package/src/Number.ts +26 -0
- package/src/Option.ts +17 -17
- package/src/ReadonlyArray.ts +23 -15
- package/src/ReadonlyRecord.ts +421 -265
- package/src/Reloadable.ts +4 -4
- package/src/RequestResolver.ts +19 -19
- package/src/Resource.ts +3 -3
- package/src/STM.ts +166 -213
- package/src/Schedule.ts +331 -361
- package/src/SingleProducerAsyncInput.ts +1 -1
- package/src/Sink.ts +19 -19
- package/src/Stream.ts +449 -456
- package/src/Struct.ts +8 -5
- package/src/SubscriptionRef.ts +2 -2
- package/src/TArray.ts +2 -2
- package/src/TDeferred.ts +4 -4
- package/src/TMap.ts +10 -10
- package/src/TSet.ts +4 -4
- package/src/Take.ts +4 -4
- package/src/TestAnnotation.ts +5 -8
- package/src/Types.ts +11 -0
- package/src/internal/blockedRequests.ts +2 -2
- package/src/internal/cause.ts +2 -2
- package/src/internal/channel/channelExecutor.ts +26 -26
- package/src/internal/channel/channelState.ts +13 -13
- package/src/internal/channel/mergeDecision.ts +1 -1
- package/src/internal/channel/mergeState.ts +6 -6
- package/src/internal/channel/singleProducerAsyncInput.ts +5 -5
- package/src/internal/channel.ts +43 -43
- package/src/internal/clock.ts +3 -4
- package/src/internal/config.ts +7 -7
- package/src/internal/configError.ts +1 -1
- package/src/internal/configProvider/pathPatch.ts +2 -2
- package/src/internal/configProvider.ts +1 -1
- package/src/internal/core-effect.ts +28 -43
- package/src/internal/core.ts +15 -40
- package/src/internal/dataSource.ts +26 -26
- package/src/internal/differ/orPatch.ts +7 -7
- package/src/internal/differ.ts +2 -2
- package/src/internal/effect/circular.ts +9 -10
- package/src/internal/either.ts +25 -22
- package/src/internal/encoding/base64.ts +1 -1
- package/src/internal/encoding/base64Url.ts +1 -1
- package/src/internal/encoding/hex.ts +1 -1
- package/src/internal/fiber.ts +2 -2
- package/src/internal/fiberRuntime.ts +9 -9
- package/src/internal/groupBy.ts +40 -40
- package/src/internal/layer/circular.ts +4 -4
- package/src/internal/layer.ts +52 -54
- package/src/internal/matcher.ts +5 -5
- package/src/internal/metric/polling.ts +8 -8
- package/src/internal/metric.ts +6 -6
- package/src/internal/reloadable.ts +4 -4
- package/src/internal/resource.ts +2 -2
- package/src/internal/runtime.ts +32 -19
- package/src/internal/schedule.ts +430 -500
- package/src/internal/sink.ts +27 -29
- package/src/internal/stm/core.ts +23 -23
- package/src/internal/stm/stm.ts +158 -157
- package/src/internal/stm/tArray.ts +3 -3
- package/src/internal/stm/tDeferred.ts +5 -5
- package/src/internal/stm/tMap.ts +13 -13
- package/src/internal/stm/tSet.ts +4 -4
- package/src/internal/stream.ts +688 -723
- package/src/internal/subscriptionRef.ts +3 -3
- package/src/internal/take.ts +6 -6
- package/src/internal/version.ts +1 -1
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.fromEffectOption = exports.fromEffect = exports.fromChunks = exports.fromChunkQueue = exports.fromChunkPubSub = exports.fromChunk = exports.fromChannel = exports.fromAsyncIterable = exports.forever = exports.flattenTake = exports.flattenIterables = exports.flattenExitOption = exports.flattenEffect = exports.flattenChunks = exports.flatten = exports.flatMap = exports.findEffect = exports.find = exports.finalizer = exports.filterMapWhileEffect = exports.filterMapWhile = exports.filterMapEffect = exports.filterMap = exports.filterEffect = exports.filter = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.execute = exports.ensuringWith = exports.ensuring = exports.encodeText = exports.empty = exports.either = exports.dropWhileEffect = exports.dropWhile = exports.dropUntilEffect = exports.dropUntil = exports.dropRight = exports.drop = exports.drainFork = exports.drain = exports.distributedWithDynamicCallback = exports.distributedWithDynamic = exports.distributedWith = exports.dieSync = exports.dieMessage = exports.die = exports.decodeText = exports.debounce = exports.crossWith = exports.crossRight = exports.crossLeft = exports.cross = exports.contextWithStream = exports.contextWithEffect = exports.contextWith = exports.context = exports.concatAll = exports.concat = exports.combineChunks = exports.combine = exports.chunksWith = exports.chunks = exports.channelToStream = exports.changesWithEffect = exports.changesWith = exports.changes = exports.catchTags = exports.catchTag = exports.catchSomeCause = exports.catchSome = exports.catchAllCause = exports.catchAll = exports.bufferChunks = exports.buffer = exports.broadcastedQueuesDynamic = exports.broadcastedQueues = exports.broadcastDynamic = exports.broadcast = exports.branchAfter = exports.bindTo = exports.bind = exports.asyncScoped = exports.
|
|
7
|
-
exports.runDrain = exports.runCount = exports.runCollect = exports.run = exports.retry = exports.
|
|
8
|
-
exports.zipWithPreviousAndNext = exports.zipWithPrevious = exports.zipWithNext = exports.zipWithIndex = exports.zipWithChunks = exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipLatestWith = exports.zipLatest = exports.zipFlatten = exports.zipAllWith = exports.zipAllSortedByKeyWith = exports.zipAllSortedByKeyRight = exports.zipAllSortedByKeyLeft = exports.zipAllSortedByKey = exports.zipAllRight = exports.zipAllLeft = exports.zipAll = exports.zip = exports.withSpan = exports.whenEffect = exports.whenCaseEffect = exports.whenCase = exports.when = exports.updateService = exports.unwrapScoped = exports.unwrap = exports.unit = exports.unfoldEffect = exports.unfoldChunkEffect = exports.unfoldChunk = exports.unfold = exports.transduce = exports.toReadableStream = exports.toQueueOfElements = exports.toQueue = exports.toPull = exports.toPubSub = exports.toChannel = exports.timeoutTo = exports.timeoutFailCause = exports.timeoutFail = exports.timeout = exports.tick = exports.throttleEffect = exports.throttle = exports.tapSink = exports.tapErrorCause = exports.tapError = exports.tapBoth = exports.tap = exports.takeWhile = exports.takeUntilEffect = exports.takeUntil = exports.takeRight = exports.take = exports.sync = exports.suspend = exports.succeed = exports.splitOnChunk = exports.splitLines = exports.split = exports.someOrFail = exports.someOrElse = exports.some = exports.slidingSize = exports.sliding = exports.scoped = exports.scheduleWith = exports.schedule = exports.scanReduceEffect = exports.scanReduce = exports.scanEffect = exports.scan = exports.runSum = exports.runScoped = exports.runLast = exports.runIntoQueueScoped = exports.runIntoQueueElementsScoped = exports.runIntoQueue = exports.runIntoPubSubScoped = exports.runIntoPubSub = exports.runHead = exports.runForEachWhileScoped = exports.runForEachWhile = exports.runForEachScoped = exports.runForEachChunkScoped = exports.runForEachChunk = exports.runForEach = exports.runFoldWhileScopedEffect = exports.runFoldWhileScoped = exports.runFoldWhileEffect = exports.runFoldWhile = exports.runFoldScopedEffect =
|
|
6
|
+
exports.fromIterableEffect = exports.fromIterable = exports.fromEffectOption = exports.fromEffect = exports.fromChunks = exports.fromChunkQueue = exports.fromChunkPubSub = exports.fromChunk = exports.fromChannel = exports.fromAsyncIterable = exports.forever = exports.flattenTake = exports.flattenIterables = exports.flattenExitOption = exports.flattenEffect = exports.flattenChunks = exports.flatten = exports.flatMap = exports.findEffect = exports.find = exports.finalizer = exports.filterMapWhileEffect = exports.filterMapWhile = exports.filterMapEffect = exports.filterMap = exports.filterEffect = exports.filter = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.execute = exports.ensuringWith = exports.ensuring = exports.encodeText = exports.empty = exports.either = exports.dropWhileEffect = exports.dropWhile = exports.dropUntilEffect = exports.dropUntil = exports.dropRight = exports.drop = exports.drainFork = exports.drain = exports.distributedWithDynamicCallback = exports.distributedWithDynamic = exports.distributedWith = exports.dieSync = exports.dieMessage = exports.die = exports.decodeText = exports.debounce = exports.crossWith = exports.crossRight = exports.crossLeft = exports.cross = exports.contextWithStream = exports.contextWithEffect = exports.contextWith = exports.context = exports.concatAll = exports.concat = exports.combineChunks = exports.combine = exports.chunksWith = exports.chunks = exports.channelToStream = exports.changesWithEffect = exports.changesWith = exports.changes = exports.catchTags = exports.catchTag = exports.catchSomeCause = exports.catchSome = exports.catchAllCause = exports.catchAll = exports.bufferChunks = exports.buffer = exports.broadcastedQueuesDynamic = exports.broadcastedQueues = exports.broadcastDynamic = exports.broadcast = exports.branchAfter = exports.bindTo = exports.bind = exports.asyncScoped = exports.asyncEffect = exports.as = exports.aggregateWithinEither = exports.aggregateWithin = exports.aggregate = exports.acquireRelease = exports.accumulateChunks = exports.accumulate = exports._async = exports.StreamTypeId = exports.StreamImpl = exports.Do = exports.DefaultChunkSize = void 0;
|
|
7
|
+
exports.runFoldScoped = exports.runFoldEffect = exports.runFold = exports.runDrain = exports.runCount = exports.runCollect = exports.run = exports.retry = exports.repeatWith = exports.repeatValue = exports.repeatElementsWith = exports.repeatElements = exports.repeatEither = exports.repeatEffectWithSchedule = exports.repeatEffectOption = exports.repeatEffectChunkOption = exports.repeatEffectChunk = exports.repeatEffect = exports.repeat = exports.refineOrDieWith = exports.refineOrDie = exports.rechunk = exports.range = exports.provideSomeLayer = exports.provideServiceStream = exports.provideServiceEffect = exports.provideService = exports.provideLayer = exports.provideContext = exports.prepend = exports.pipeThroughChannelOrFail = exports.pipeThroughChannel = exports.pipeThrough = exports.peel = exports.partitionEither = exports.partition = exports.paginateEffect = exports.paginateChunkEffect = exports.paginateChunk = exports.paginate = exports.orElseSucceed = exports.orElseIfEmptyStream = exports.orElseIfEmptyChunk = exports.orElseIfEmpty = exports.orElseFail = exports.orElseEither = exports.orElse = exports.orDieWith = exports.orDie = exports.onError = exports.onDone = exports.never = exports.mkString = exports.mergeWith = exports.mergeRight = exports.mergeLeft = exports.mergeEither = exports.mergeAll = exports.merge = exports.matchConcurrency = exports.mapInputContext = exports.mapErrorCause = exports.mapError = exports.mapEffectSequential = exports.mapEffectPar = exports.mapConcatEffect = exports.mapConcatChunkEffect = exports.mapConcatChunk = exports.mapConcat = exports.mapChunksEffect = exports.mapChunks = exports.mapBoth = exports.mapAccumEffect = exports.mapAccum = exports.map = exports.make = exports.let_ = exports.iterate = exports.isStream = exports.intersperseAffixes = exports.intersperse = exports.interruptWhenDeferred = exports.interruptWhen = exports.interruptAfter = exports.interleaveWith = exports.interleave = exports.identityStream = exports.haltWhenDeferred = exports.haltWhen = exports.haltAfter = exports.groupedWithin = exports.grouped = exports.groupAdjacentBy = exports.fromSchedule = exports.fromReadableStreamByob = exports.fromReadableStream = exports.fromQueue = exports.fromPull = exports.fromPubSub = exports.fromIteratorSucceed = void 0;
|
|
8
|
+
exports.zipWithPreviousAndNext = exports.zipWithPrevious = exports.zipWithNext = exports.zipWithIndex = exports.zipWithChunks = exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipLatestWith = exports.zipLatest = exports.zipFlatten = exports.zipAllWith = exports.zipAllSortedByKeyWith = exports.zipAllSortedByKeyRight = exports.zipAllSortedByKeyLeft = exports.zipAllSortedByKey = exports.zipAllRight = exports.zipAllLeft = exports.zipAll = exports.zip = exports.withSpan = exports.whenEffect = exports.whenCaseEffect = exports.whenCase = exports.when = exports.updateService = exports.unwrapScoped = exports.unwrap = exports.unit = exports.unfoldEffect = exports.unfoldChunkEffect = exports.unfoldChunk = exports.unfold = exports.transduce = exports.toReadableStream = exports.toQueueOfElements = exports.toQueue = exports.toPull = exports.toPubSub = exports.toChannel = exports.timeoutTo = exports.timeoutFailCause = exports.timeoutFail = exports.timeout = exports.tick = exports.throttleEffect = exports.throttle = exports.tapSink = exports.tapErrorCause = exports.tapError = exports.tapBoth = exports.tap = exports.takeWhile = exports.takeUntilEffect = exports.takeUntil = exports.takeRight = exports.take = exports.sync = exports.suspend = exports.succeed = exports.splitOnChunk = exports.splitLines = exports.split = exports.someOrFail = exports.someOrElse = exports.some = exports.slidingSize = exports.sliding = exports.scoped = exports.scheduleWith = exports.schedule = exports.scanReduceEffect = exports.scanReduce = exports.scanEffect = exports.scan = exports.runSum = exports.runScoped = exports.runLast = exports.runIntoQueueScoped = exports.runIntoQueueElementsScoped = exports.runIntoQueue = exports.runIntoPubSubScoped = exports.runIntoPubSub = exports.runHead = exports.runForEachWhileScoped = exports.runForEachWhile = exports.runForEachScoped = exports.runForEachChunkScoped = exports.runForEachChunk = exports.runForEach = exports.runFoldWhileScopedEffect = exports.runFoldWhileScoped = exports.runFoldWhileEffect = exports.runFoldWhile = exports.runFoldScopedEffect = void 0;
|
|
9
9
|
var Cause = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("../Cause.js"));
|
|
10
10
|
var Chunk = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("../Chunk.js"));
|
|
11
11
|
var Clock = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("../Clock.js"));
|
|
@@ -47,7 +47,7 @@ var pull = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./stream/
|
|
|
47
47
|
var SinkEndReason = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./stream/sinkEndReason.js"));
|
|
48
48
|
var ZipAllState = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./stream/zipAllState.js"));
|
|
49
49
|
var ZipChunksState = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./stream/zipChunksState.js"));
|
|
50
|
-
var
|
|
50
|
+
var InternalTake = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./take.js"));
|
|
51
51
|
function _getRequireWildcardCache(e) {
|
|
52
52
|
if ("function" != typeof WeakMap) return null;
|
|
53
53
|
var r = new WeakMap(),
|
|
@@ -200,20 +200,36 @@ const aggregateWithinEither = exports.aggregateWithinEither = /*#__PURE__*/(0, _
|
|
|
200
200
|
/** @internal */
|
|
201
201
|
const as = exports.as = /*#__PURE__*/(0, _Function.dual)(2, (self, value) => map(self, () => value));
|
|
202
202
|
/** @internal */
|
|
203
|
-
const _async = (register, outputBuffer = 16) =>
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
const _async = (register, outputBuffer = 16) => Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)).pipe(Effect.flatMap(output => Effect.runtime().pipe(Effect.flatMap(runtime => Effect.sync(() => {
|
|
204
|
+
const runPromiseExit = Runtime.runPromiseExit(runtime);
|
|
205
|
+
const canceler = register(emit.make(resume => InternalTake.fromPull(resume).pipe(Effect.flatMap(take => Queue.offer(output, take)), Effect.asUnit, runPromiseExit).then(exit => {
|
|
206
|
+
if (Exit.isFailure(exit)) {
|
|
207
|
+
if (!Cause.isInterrupted(exit.cause)) {
|
|
208
|
+
throw Cause.squash(exit.cause);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
})));
|
|
212
|
+
return canceler;
|
|
213
|
+
})), Effect.map(value => {
|
|
214
|
+
const loop = Queue.take(output).pipe(Effect.flatMap(take => InternalTake.done(take)), Effect.match({
|
|
215
|
+
onFailure: maybeError => core.fromEffect(Queue.shutdown(output)).pipe(channel.zipRight(Option.match(maybeError, {
|
|
216
|
+
onNone: () => core.unit,
|
|
217
|
+
onSome: error => core.fail(error)
|
|
218
|
+
}))),
|
|
219
|
+
onSuccess: chunk => core.write(chunk).pipe(core.flatMap(() => loop))
|
|
220
|
+
}), channel.unwrap);
|
|
221
|
+
return fromChannel(loop).pipe(ensuring(value ?? Effect.unit));
|
|
222
|
+
}))), unwrapScoped);
|
|
207
223
|
/** @internal */
|
|
208
224
|
exports._async = _async;
|
|
209
|
-
const asyncEffect = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)), Effect.flatMap(output => (0, _Function.pipe)(Effect.runtime(), Effect.flatMap(runtime => (0, _Function.pipe)(register(emit.make(k => (0, _Function.pipe)(
|
|
225
|
+
const asyncEffect = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)), Effect.flatMap(output => (0, _Function.pipe)(Effect.runtime(), Effect.flatMap(runtime => (0, _Function.pipe)(register(emit.make(k => (0, _Function.pipe)(InternalTake.fromPull(k), Effect.flatMap(take => Queue.offer(output, take)), Effect.asUnit, Runtime.runPromiseExit(runtime)).then(exit => {
|
|
210
226
|
if (Exit.isFailure(exit)) {
|
|
211
227
|
if (!Cause.isInterrupted(exit.cause)) {
|
|
212
228
|
throw Cause.squash(exit.cause);
|
|
213
229
|
}
|
|
214
230
|
}
|
|
215
231
|
}))), Effect.map(() => {
|
|
216
|
-
const loop = (0, _Function.pipe)(Queue.take(output), Effect.flatMap(
|
|
232
|
+
const loop = (0, _Function.pipe)(Queue.take(output), Effect.flatMap(InternalTake.done), Effect.match({
|
|
217
233
|
onFailure: maybeError => (0, _Function.pipe)(core.fromEffect(Queue.shutdown(output)), channel.zipRight(Option.match(maybeError, {
|
|
218
234
|
onNone: () => core.unit,
|
|
219
235
|
onSome: core.fail
|
|
@@ -224,40 +240,13 @@ const asyncEffect = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.
|
|
|
224
240
|
}))))), channel.unwrapScoped, fromChannel);
|
|
225
241
|
/** @internal */
|
|
226
242
|
exports.asyncEffect = asyncEffect;
|
|
227
|
-
const
|
|
228
|
-
if (Exit.isFailure(exit)) {
|
|
229
|
-
if (!Cause.isInterrupted(exit.cause)) {
|
|
230
|
-
throw Cause.squash(exit.cause);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
})))), Effect.map(Either.match({
|
|
234
|
-
onLeft: canceler => {
|
|
235
|
-
const loop = (0, _Function.pipe)(Queue.take(output), Effect.flatMap(_take.done), Effect.match({
|
|
236
|
-
onFailure: maybeError => channel.zipRight(core.fromEffect(Queue.shutdown(output)), Option.match(maybeError, {
|
|
237
|
-
onNone: () => core.unit,
|
|
238
|
-
onSome: core.fail
|
|
239
|
-
})),
|
|
240
|
-
onSuccess: chunk => (0, _Function.pipe)(core.write(chunk), core.flatMap(() => loop))
|
|
241
|
-
}), channel.unwrap);
|
|
242
|
-
return (0, _Function.pipe)(fromChannel(loop), ensuring(canceler));
|
|
243
|
-
},
|
|
244
|
-
onRight: stream => unwrap((0, _Function.pipe)(Queue.shutdown(output), Effect.as(stream)))
|
|
245
|
-
})))))), unwrapScoped);
|
|
246
|
-
/** @internal */
|
|
247
|
-
exports.asyncInterrupt = asyncInterrupt;
|
|
248
|
-
const asyncOption = (register, outputBuffer = 16) => asyncInterrupt(emit => Option.match(register(emit), {
|
|
249
|
-
onNone: () => Either.left(Effect.unit),
|
|
250
|
-
onSome: Either.right
|
|
251
|
-
}), outputBuffer);
|
|
252
|
-
/** @internal */
|
|
253
|
-
exports.asyncOption = asyncOption;
|
|
254
|
-
const asyncScoped = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)), Effect.flatMap(output => (0, _Function.pipe)(Effect.runtime(), Effect.flatMap(runtime => (0, _Function.pipe)(register(emit.make(k => (0, _Function.pipe)(_take.fromPull(k), Effect.flatMap(take => Queue.offer(output, take)), Effect.asUnit, Runtime.runPromiseExit(runtime)).then(exit => {
|
|
243
|
+
const asyncScoped = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.acquireRelease(Queue.bounded(outputBuffer), queue => Queue.shutdown(queue)), Effect.flatMap(output => (0, _Function.pipe)(Effect.runtime(), Effect.flatMap(runtime => (0, _Function.pipe)(register(emit.make(k => (0, _Function.pipe)(InternalTake.fromPull(k), Effect.flatMap(take => Queue.offer(output, take)), Effect.asUnit, Runtime.runPromiseExit(runtime)).then(exit => {
|
|
255
244
|
if (Exit.isFailure(exit)) {
|
|
256
245
|
if (!Cause.isInterrupted(exit.cause)) {
|
|
257
246
|
throw Cause.squash(exit.cause);
|
|
258
247
|
}
|
|
259
248
|
}
|
|
260
|
-
}))), Effect.zipRight(Ref.make(false)), Effect.flatMap(ref => (0, _Function.pipe)(Ref.get(ref), Effect.map(isDone => isDone ? pull.end() : (0, _Function.pipe)(Queue.take(output), Effect.flatMap(
|
|
249
|
+
}))), Effect.zipRight(Ref.make(false)), Effect.flatMap(ref => (0, _Function.pipe)(Ref.get(ref), Effect.map(isDone => isDone ? pull.end() : (0, _Function.pipe)(Queue.take(output), Effect.flatMap(InternalTake.done), Effect.onError(() => (0, _Function.pipe)(Ref.set(ref, true), Effect.zipRight(Queue.shutdown(output)))))))))))), scoped, flatMap(repeatEffectChunkOption));
|
|
261
250
|
/** @internal */
|
|
262
251
|
exports.asyncScoped = asyncScoped;
|
|
263
252
|
const branchAfter = exports.branchAfter = /*#__PURE__*/(0, _Function.dual)(3, (self, n, f) => suspend(() => {
|
|
@@ -318,7 +307,7 @@ const bufferChunks = exports.bufferChunks = /*#__PURE__*/(0, _Function.dual)(2,
|
|
|
318
307
|
}
|
|
319
308
|
const queue = toQueue(self, options);
|
|
320
309
|
return new StreamImpl(channel.unwrapScoped(Effect.map(queue, queue => {
|
|
321
|
-
const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(
|
|
310
|
+
const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(InternalTake.match({
|
|
322
311
|
onEnd: () => core.unit,
|
|
323
312
|
onFailure: core.failCause,
|
|
324
313
|
onSuccess: value => (0, _Function.pipe)(core.write(value), core.flatMap(() => process))
|
|
@@ -347,7 +336,7 @@ const bufferUnbounded = self => {
|
|
|
347
336
|
strategy: "unbounded"
|
|
348
337
|
});
|
|
349
338
|
return new StreamImpl(channel.unwrapScoped(Effect.map(queue, queue => {
|
|
350
|
-
const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(
|
|
339
|
+
const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(InternalTake.match({
|
|
351
340
|
onEnd: () => core.unit,
|
|
352
341
|
onFailure: core.failCause,
|
|
353
342
|
onSuccess: value => core.flatMap(core.write(value), () => process)
|
|
@@ -359,13 +348,13 @@ const bufferSignal = (scoped, bufferChannel) => {
|
|
|
359
348
|
const producer = (queue, ref) => {
|
|
360
349
|
const terminate = take => (0, _Function.pipe)(Ref.get(ref), Effect.tap(Deferred.await), Effect.zipRight(Deferred.make()), Effect.flatMap(deferred => (0, _Function.pipe)(Queue.offer(queue, [take, deferred]), Effect.zipRight(Ref.set(ref, deferred)), Effect.zipRight(Deferred.await(deferred)))), Effect.asUnit, core.fromEffect);
|
|
361
350
|
return core.readWithCause({
|
|
362
|
-
onInput: input => (0, _Function.pipe)(Deferred.make(), Effect.flatMap(deferred => (0, _Function.pipe)(Queue.offer(queue, [
|
|
363
|
-
onFailure: error => terminate(
|
|
364
|
-
onDone: () => terminate(
|
|
351
|
+
onInput: input => (0, _Function.pipe)(Deferred.make(), Effect.flatMap(deferred => (0, _Function.pipe)(Queue.offer(queue, [InternalTake.chunk(input), deferred]), Effect.flatMap(added => (0, _Function.pipe)(Ref.set(ref, deferred), Effect.when(() => added))))), Effect.asUnit, core.fromEffect, core.flatMap(() => producer(queue, ref))),
|
|
352
|
+
onFailure: error => terminate(InternalTake.failCause(error)),
|
|
353
|
+
onDone: () => terminate(InternalTake.end)
|
|
365
354
|
});
|
|
366
355
|
};
|
|
367
356
|
const consumer = queue => {
|
|
368
|
-
const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(([take, deferred]) => channel.zipRight(core.fromEffect(Deferred.succeed(deferred, void 0)),
|
|
357
|
+
const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(([take, deferred]) => channel.zipRight(core.fromEffect(Deferred.succeed(deferred, void 0)), InternalTake.match(take, {
|
|
369
358
|
onEnd: () => core.unit,
|
|
370
359
|
onFailure: core.failCause,
|
|
371
360
|
onSuccess: value => (0, _Function.pipe)(core.write(value), core.flatMap(() => process))
|
|
@@ -466,13 +455,13 @@ const combine = exports.combine = /*#__PURE__*/(0, _Function.dual)(4, (self, tha
|
|
|
466
455
|
/** @internal */
|
|
467
456
|
const combineChunks = exports.combineChunks = /*#__PURE__*/(0, _Function.dual)(4, (self, that, s, f) => {
|
|
468
457
|
const producer = (handoff, latch) => channel.zipRight(core.fromEffect(Handoff.take(latch)), core.readWithCause({
|
|
469
|
-
onInput: input => core.flatMap(core.fromEffect((0, _Function.pipe)(handoff, Handoff.offer(
|
|
470
|
-
onFailure: cause => core.fromEffect(Handoff.offer(handoff,
|
|
471
|
-
onDone: () => core.fromEffect(Handoff.offer(handoff,
|
|
458
|
+
onInput: input => core.flatMap(core.fromEffect((0, _Function.pipe)(handoff, Handoff.offer(InternalTake.chunk(input)))), () => producer(handoff, latch)),
|
|
459
|
+
onFailure: cause => core.fromEffect(Handoff.offer(handoff, InternalTake.failCause(cause))),
|
|
460
|
+
onDone: () => core.fromEffect(Handoff.offer(handoff, InternalTake.end))
|
|
472
461
|
}));
|
|
473
462
|
return new StreamImpl((0, _Function.pipe)(Effect.all([Handoff.make(), Handoff.make(), Handoff.make(), Handoff.make()]), Effect.tap(([left, _, latchL]) => (0, _Function.pipe)(toChannel(self), core.pipeTo(producer(left, latchL)), channelExecutor.runScoped, Effect.forkScoped)), Effect.tap(([_, right, __, latchR]) => (0, _Function.pipe)(toChannel(that), core.pipeTo(producer(right, latchR)), channelExecutor.runScoped, Effect.forkScoped)), Effect.map(([left, right, latchL, latchR]) => {
|
|
474
|
-
const pullLeft = (0, _Function.pipe)(latchL, Handoff.offer(void 0), Effect.zipRight((0, _Function.pipe)(Handoff.take(left), Effect.flatMap(
|
|
475
|
-
const pullRight = (0, _Function.pipe)(latchR, Handoff.offer(void 0), Effect.zipRight((0, _Function.pipe)(Handoff.take(right), Effect.flatMap(
|
|
463
|
+
const pullLeft = (0, _Function.pipe)(latchL, Handoff.offer(void 0), Effect.zipRight((0, _Function.pipe)(Handoff.take(left), Effect.flatMap(InternalTake.done))));
|
|
464
|
+
const pullRight = (0, _Function.pipe)(latchR, Handoff.offer(void 0), Effect.zipRight((0, _Function.pipe)(Handoff.take(right), Effect.flatMap(InternalTake.done))));
|
|
476
465
|
return toChannel(unfoldChunkEffect(s, s => Effect.flatMap(f(s, pullLeft, pullRight), unsome)));
|
|
477
466
|
}), channel.unwrapScoped));
|
|
478
467
|
});
|
|
@@ -1207,22 +1196,22 @@ const interleave = exports.interleave = /*#__PURE__*/(0, _Function.dual)(2, (sel
|
|
|
1207
1196
|
/** @internal */
|
|
1208
1197
|
const interleaveWith = exports.interleaveWith = /*#__PURE__*/(0, _Function.dual)(3, (self, that, decider) => {
|
|
1209
1198
|
const producer = handoff => core.readWithCause({
|
|
1210
|
-
onInput: value => core.flatMap(core.fromEffect(Handoff.offer(handoff,
|
|
1211
|
-
onFailure: cause => core.fromEffect(Handoff.offer(handoff,
|
|
1212
|
-
onDone: () => core.fromEffect(Handoff.offer(handoff,
|
|
1199
|
+
onInput: value => core.flatMap(core.fromEffect(Handoff.offer(handoff, InternalTake.of(value))), () => producer(handoff)),
|
|
1200
|
+
onFailure: cause => core.fromEffect(Handoff.offer(handoff, InternalTake.failCause(cause))),
|
|
1201
|
+
onDone: () => core.fromEffect(Handoff.offer(handoff, InternalTake.end))
|
|
1213
1202
|
});
|
|
1214
1203
|
return new StreamImpl(channel.unwrapScoped((0, _Function.pipe)(Handoff.make(), Effect.zip(Handoff.make()), Effect.tap(([left]) => (0, _Function.pipe)(toChannel(self), channel.concatMap(channel.writeChunk), core.pipeTo(producer(left)), channelExecutor.runScoped, Effect.forkScoped)), Effect.tap(([_, right]) => (0, _Function.pipe)(toChannel(that), channel.concatMap(channel.writeChunk), core.pipeTo(producer(right)), channelExecutor.runScoped, Effect.forkScoped)), Effect.map(([left, right]) => {
|
|
1215
1204
|
const process = (leftDone, rightDone) => core.readWithCause({
|
|
1216
1205
|
onInput: bool => {
|
|
1217
1206
|
if (bool && !leftDone) {
|
|
1218
|
-
return (0, _Function.pipe)(core.fromEffect(Handoff.take(left)), core.flatMap(
|
|
1207
|
+
return (0, _Function.pipe)(core.fromEffect(Handoff.take(left)), core.flatMap(InternalTake.match({
|
|
1219
1208
|
onEnd: () => rightDone ? core.unit : process(true, rightDone),
|
|
1220
1209
|
onFailure: core.failCause,
|
|
1221
1210
|
onSuccess: chunk => (0, _Function.pipe)(core.write(chunk), core.flatMap(() => process(leftDone, rightDone)))
|
|
1222
1211
|
})));
|
|
1223
1212
|
}
|
|
1224
1213
|
if (!bool && !rightDone) {
|
|
1225
|
-
return (0, _Function.pipe)(core.fromEffect(Handoff.take(right)), core.flatMap(
|
|
1214
|
+
return (0, _Function.pipe)(core.fromEffect(Handoff.take(right)), core.flatMap(InternalTake.match({
|
|
1226
1215
|
onEnd: () => leftDone ? core.unit : process(leftDone, true),
|
|
1227
1216
|
onFailure: core.failCause,
|
|
1228
1217
|
onSuccess: chunk => (0, _Function.pipe)(core.write(chunk), core.flatMap(() => process(leftDone, rightDone)))
|
|
@@ -1690,10 +1679,8 @@ const repeatWith = exports.repeatWith = /*#__PURE__*/(0, _Function.dual)(3, (sel
|
|
|
1690
1679
|
return new StreamImpl((0, _Function.pipe)(process, channel.zipRight(loop)));
|
|
1691
1680
|
}), unwrap);
|
|
1692
1681
|
});
|
|
1693
|
-
/** @internal */
|
|
1694
1682
|
const repeatWithSchedule = (value, schedule) => repeatEffectWithSchedule(Effect.succeed(value), schedule);
|
|
1695
1683
|
/** @internal */
|
|
1696
|
-
exports.repeatWithSchedule = repeatWithSchedule;
|
|
1697
1684
|
const repeatEffectWithSchedule = (effect, schedule) => flatMap(fromEffect(Effect.zip(effect, Schedule.driver(schedule))), ([a, driver]) => concat(succeed(a), unfoldEffect(a, s => Effect.matchEffect(driver.next(s), {
|
|
1698
1685
|
onFailure: Effect.succeed,
|
|
1699
1686
|
onSuccess: () => Effect.map(effect, nextA => Option.some([nextA, nextA]))
|
|
@@ -1767,9 +1754,9 @@ const runIntoQueueElementsScoped = exports.runIntoQueueElementsScoped = /*#__PUR
|
|
|
1767
1754
|
/** @internal */
|
|
1768
1755
|
const runIntoQueueScoped = exports.runIntoQueueScoped = /*#__PURE__*/(0, _Function.dual)(2, (self, queue) => {
|
|
1769
1756
|
const writer = core.readWithCause({
|
|
1770
|
-
onInput: input => core.flatMap(core.write(
|
|
1771
|
-
onFailure: cause => core.write(
|
|
1772
|
-
onDone: () => core.write(
|
|
1757
|
+
onInput: input => core.flatMap(core.write(InternalTake.chunk(input)), () => writer),
|
|
1758
|
+
onFailure: cause => core.write(InternalTake.failCause(cause)),
|
|
1759
|
+
onDone: () => core.write(InternalTake.end)
|
|
1773
1760
|
});
|
|
1774
1761
|
return (0, _Function.pipe)(core.pipeTo(toChannel(self), writer), channel.mapOutEffect(take => Queue.offer(queue, take)), channel.drain, channelExecutor.runScoped, Effect.asUnit);
|
|
1775
1762
|
});
|
|
@@ -2122,20 +2109,20 @@ const tapSink = exports.tapSink = /*#__PURE__*/(0, _Function.dual)(2, (self, sin
|
|
|
2122
2109
|
maxChunkSize: 1
|
|
2123
2110
|
}));
|
|
2124
2111
|
const loop = core.readWithCause({
|
|
2125
|
-
onInput: chunk => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue,
|
|
2112
|
+
onInput: chunk => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue, InternalTake.chunk(chunk))), core.foldCauseChannel({
|
|
2126
2113
|
onFailure: () => core.flatMap(core.write(chunk), () => channel.identityChannel()),
|
|
2127
2114
|
onSuccess: () => core.flatMap(core.write(chunk), () => loop)
|
|
2128
2115
|
})),
|
|
2129
|
-
onFailure: cause => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue,
|
|
2116
|
+
onFailure: cause => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue, InternalTake.failCause(cause))), core.foldCauseChannel({
|
|
2130
2117
|
onFailure: () => core.failCause(cause),
|
|
2131
2118
|
onSuccess: () => core.failCause(cause)
|
|
2132
2119
|
})),
|
|
2133
|
-
onDone: () => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue,
|
|
2120
|
+
onDone: () => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue, InternalTake.end)), core.foldCauseChannel({
|
|
2134
2121
|
onFailure: () => core.unit,
|
|
2135
2122
|
onSuccess: () => core.unit
|
|
2136
2123
|
}))
|
|
2137
2124
|
});
|
|
2138
|
-
return (0, _Function.pipe)(new StreamImpl((0, _Function.pipe)(core.pipeTo(toChannel(self), loop), channel.ensuring(Effect.zipRight(Effect.forkDaemon(Queue.offer(queue,
|
|
2125
|
+
return (0, _Function.pipe)(new StreamImpl((0, _Function.pipe)(core.pipeTo(toChannel(self), loop), channel.ensuring(Effect.zipRight(Effect.forkDaemon(Queue.offer(queue, InternalTake.end)), Deferred.await(deferred))))), merge(execute((0, _Function.pipe)(run(right, sink), Effect.ensuring(Effect.zipRight(Queue.shutdown(queue), Deferred.succeed(deferred, void 0)))))));
|
|
2139
2126
|
})));
|
|
2140
2127
|
/** @internal */
|
|
2141
2128
|
const throttle = exports.throttle = /*#__PURE__*/(0, _Function.dual)(2, (self, options) => throttleEffect(self, {
|