effect 2.4.19 → 3.0.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/Array/package.json +6 -0
- package/FiberHandle/package.json +6 -0
- package/Record/package.json +6 -0
- package/dist/cjs/{ReadonlyArray.js → Array.js} +46 -23
- package/dist/cjs/Array.js.map +1 -0
- package/dist/cjs/Brand.js +2 -2
- package/dist/cjs/Brand.js.map +1 -1
- package/dist/cjs/Channel.js +4 -8
- package/dist/cjs/Channel.js.map +1 -1
- package/dist/cjs/Chunk.js +5 -1
- package/dist/cjs/Chunk.js.map +1 -1
- package/dist/cjs/ConfigError.js.map +1 -1
- package/dist/cjs/Cron.js +13 -13
- package/dist/cjs/Cron.js.map +1 -1
- package/dist/cjs/Effect.js +14 -10
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Either.js +4 -1
- package/dist/cjs/Either.js.map +1 -1
- package/dist/cjs/ExecutionStrategy.js.map +1 -1
- package/dist/cjs/Exit.js +3 -9
- package/dist/cjs/Exit.js.map +1 -1
- package/dist/cjs/Fiber.js +2 -8
- package/dist/cjs/Fiber.js.map +1 -1
- package/dist/cjs/FiberHandle.js +288 -0
- package/dist/cjs/FiberHandle.js.map +1 -0
- package/dist/cjs/FiberMap.js +86 -27
- package/dist/cjs/FiberMap.js.map +1 -1
- package/dist/cjs/FiberRefs.js.map +1 -1
- package/dist/cjs/FiberSet.js +51 -15
- package/dist/cjs/FiberSet.js.map +1 -1
- package/dist/cjs/HashMap.js.map +1 -1
- package/dist/cjs/HashSet.js.map +1 -1
- package/dist/cjs/Iterable.js +40 -5
- package/dist/cjs/Iterable.js.map +1 -1
- package/dist/cjs/Layer.js.map +1 -1
- package/dist/cjs/List.js +3 -3
- package/dist/cjs/List.js.map +1 -1
- package/dist/cjs/Metric.js +3 -1
- package/dist/cjs/Metric.js.map +1 -1
- package/dist/cjs/MetricKey.js.map +1 -1
- package/dist/cjs/MetricKeyType.js.map +1 -1
- package/dist/cjs/MutableHashMap.js +0 -4
- package/dist/cjs/MutableHashMap.js.map +1 -1
- package/dist/cjs/Option.js +3 -6
- package/dist/cjs/Option.js.map +1 -1
- package/dist/cjs/{ReadonlyRecord.js → Record.js} +29 -29
- package/dist/cjs/Record.js.map +1 -0
- package/dist/cjs/STM.js +4 -10
- package/dist/cjs/STM.js.map +1 -1
- package/dist/cjs/Schedule.js +2 -2
- package/dist/cjs/Schedule.js.map +1 -1
- package/dist/cjs/ScopedCache.js.map +1 -1
- package/dist/cjs/Stream.js +3 -9
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/StreamHaltStrategy.js +2 -0
- package/dist/cjs/StreamHaltStrategy.js.map +1 -1
- package/dist/cjs/String.js +44 -2
- package/dist/cjs/String.js.map +1 -1
- package/dist/cjs/TestAnnotations.js +1 -1
- package/dist/cjs/TestAnnotations.js.map +1 -1
- package/dist/cjs/TestClock.js +3 -3
- package/dist/cjs/TestClock.js.map +1 -1
- package/dist/cjs/Tracer.js.map +1 -1
- package/dist/cjs/index.js +8 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internal/{readonlyArray.js → array.js} +1 -1
- package/dist/cjs/internal/array.js.map +1 -0
- package/dist/cjs/internal/cache.js +3 -3
- package/dist/cjs/internal/cache.js.map +1 -1
- package/dist/cjs/internal/cause.js +3 -3
- package/dist/cjs/internal/cause.js.map +1 -1
- package/dist/cjs/internal/channel/channelExecutor.js +15 -15
- package/dist/cjs/internal/channel/channelExecutor.js.map +1 -1
- package/dist/cjs/internal/channel/channelState.js +1 -1
- package/dist/cjs/internal/channel/channelState.js.map +1 -1
- package/dist/cjs/internal/channel/singleProducerAsyncInput.js +1 -1
- package/dist/cjs/internal/channel/singleProducerAsyncInput.js.map +1 -1
- package/dist/cjs/internal/channel.js +10 -10
- package/dist/cjs/internal/channel.js.map +1 -1
- package/dist/cjs/internal/clock.js +2 -2
- package/dist/cjs/internal/clock.js.map +1 -1
- package/dist/cjs/internal/configError.js +20 -19
- package/dist/cjs/internal/configError.js.map +1 -1
- package/dist/cjs/internal/configProvider/pathPatch.js +1 -1
- package/dist/cjs/internal/configProvider/pathPatch.js.map +1 -1
- package/dist/cjs/internal/configProvider.js +46 -47
- package/dist/cjs/internal/configProvider.js.map +1 -1
- package/dist/cjs/internal/core-effect.js +42 -28
- package/dist/cjs/internal/core-effect.js.map +1 -1
- package/dist/cjs/internal/core-stream.js +2 -3
- package/dist/cjs/internal/core-stream.js.map +1 -1
- package/dist/cjs/internal/core.js +27 -31
- package/dist/cjs/internal/core.js.map +1 -1
- package/dist/cjs/internal/dataSource.js +19 -2
- package/dist/cjs/internal/dataSource.js.map +1 -1
- package/dist/cjs/internal/differ/readonlyArrayPatch.js +6 -6
- package/dist/cjs/internal/differ/readonlyArrayPatch.js.map +1 -1
- package/dist/cjs/internal/effect/circular.js +1 -1
- package/dist/cjs/internal/effect/circular.js.map +1 -1
- package/dist/cjs/internal/executionStrategy.js +4 -4
- package/dist/cjs/internal/executionStrategy.js.map +1 -1
- package/dist/cjs/internal/fiber.js +5 -6
- package/dist/cjs/internal/fiber.js.map +1 -1
- package/dist/cjs/internal/fiberRefs/patch.js +1 -1
- package/dist/cjs/internal/fiberRefs/patch.js.map +1 -1
- package/dist/cjs/internal/fiberRefs.js +1 -1
- package/dist/cjs/internal/fiberRefs.js.map +1 -1
- package/dist/cjs/internal/fiberRuntime.js +33 -33
- package/dist/cjs/internal/fiberRuntime.js.map +1 -1
- package/dist/cjs/internal/groupBy.js +3 -3
- package/dist/cjs/internal/groupBy.js.map +1 -1
- package/dist/cjs/internal/hashMap.js.map +1 -1
- package/dist/cjs/internal/hashSet.js.map +1 -1
- package/dist/cjs/internal/layer/circular.js.map +1 -1
- package/dist/cjs/internal/layer.js +5 -5
- package/dist/cjs/internal/layer.js.map +1 -1
- package/dist/cjs/internal/logger.js +28 -8
- package/dist/cjs/internal/logger.js.map +1 -1
- package/dist/cjs/internal/managedRuntime.js +1 -1
- package/dist/cjs/internal/managedRuntime.js.map +1 -1
- package/dist/cjs/internal/metric/boundaries.js +4 -4
- package/dist/cjs/internal/metric/boundaries.js.map +1 -1
- package/dist/cjs/internal/metric/hook.js +20 -17
- package/dist/cjs/internal/metric/hook.js.map +1 -1
- package/dist/cjs/internal/metric/key.js +4 -4
- package/dist/cjs/internal/metric/key.js.map +1 -1
- package/dist/cjs/internal/metric/keyType.js +6 -1
- package/dist/cjs/internal/metric/keyType.js.map +1 -1
- package/dist/cjs/internal/metric/state.js +4 -4
- package/dist/cjs/internal/metric/state.js.map +1 -1
- package/dist/cjs/internal/metric.js +4 -4
- package/dist/cjs/internal/metric.js.map +1 -1
- package/dist/cjs/internal/pool.js +11 -11
- package/dist/cjs/internal/pool.js.map +1 -1
- package/dist/cjs/internal/pubsub.js +5 -5
- package/dist/cjs/internal/pubsub.js.map +1 -1
- package/dist/cjs/internal/query.js +2 -2
- package/dist/cjs/internal/query.js.map +1 -1
- package/dist/cjs/internal/queue.js +9 -9
- package/dist/cjs/internal/queue.js.map +1 -1
- package/dist/cjs/internal/rateLimiter.js +1 -1
- package/dist/cjs/internal/rateLimiter.js.map +1 -1
- package/dist/cjs/internal/redBlackTree/iterator.js +2 -2
- package/dist/cjs/internal/redBlackTree/iterator.js.map +1 -1
- package/dist/cjs/internal/reloadable.js +1 -1
- package/dist/cjs/internal/reloadable.js.map +1 -1
- package/dist/cjs/internal/runtime.js +4 -4
- package/dist/cjs/internal/runtime.js.map +1 -1
- package/dist/cjs/internal/schedule.js +5 -5
- package/dist/cjs/internal/schedule.js.map +1 -1
- package/dist/cjs/internal/scopedCache.js +7 -7
- package/dist/cjs/internal/scopedCache.js.map +1 -1
- package/dist/cjs/internal/scopedRef.js +4 -4
- package/dist/cjs/internal/scopedRef.js.map +1 -1
- package/dist/cjs/internal/secret.js +2 -2
- package/dist/cjs/internal/secret.js.map +1 -1
- package/dist/cjs/internal/sink.js +10 -10
- package/dist/cjs/internal/sink.js.map +1 -1
- package/dist/cjs/internal/stm/stm/tExit.js +2 -4
- package/dist/cjs/internal/stm/stm/tExit.js.map +1 -1
- package/dist/cjs/internal/stm/stm.js +11 -11
- package/dist/cjs/internal/stm/stm.js.map +1 -1
- package/dist/cjs/internal/stm/tMap.js +3 -3
- package/dist/cjs/internal/stm/tMap.js.map +1 -1
- package/dist/cjs/internal/stm/tPriorityQueue.js +11 -11
- package/dist/cjs/internal/stm/tPriorityQueue.js.map +1 -1
- package/dist/cjs/internal/stm/tPubSub.js +3 -3
- package/dist/cjs/internal/stm/tPubSub.js.map +1 -1
- package/dist/cjs/internal/stm/tQueue.js +3 -3
- package/dist/cjs/internal/stm/tQueue.js.map +1 -1
- package/dist/cjs/internal/stm/tSet.js +1 -1
- package/dist/cjs/internal/stm/tSet.js.map +1 -1
- package/dist/cjs/internal/stream/haltStrategy.js +5 -5
- package/dist/cjs/internal/stream/haltStrategy.js.map +1 -1
- package/dist/cjs/internal/stream.js +84 -85
- package/dist/cjs/internal/stream.js.map +1 -1
- package/dist/cjs/internal/supervisor.js +1 -1
- package/dist/cjs/internal/supervisor.js.map +1 -1
- package/dist/cjs/internal/take.js +1 -1
- package/dist/cjs/internal/take.js.map +1 -1
- package/dist/cjs/internal/tracer.js.map +1 -1
- package/dist/cjs/internal/trie.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/cjs/internal/version.js.map +1 -1
- package/dist/dts/{ReadonlyArray.d.ts → Array.d.ts} +39 -18
- package/dist/dts/Array.d.ts.map +1 -0
- package/dist/dts/BigDecimal.d.ts.map +1 -1
- package/dist/dts/BigInt.d.ts.map +1 -1
- package/dist/dts/Brand.d.ts +1 -19
- package/dist/dts/Brand.d.ts.map +1 -1
- package/dist/dts/Cache.d.ts +10 -10
- package/dist/dts/Cache.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 +6 -4
- package/dist/dts/Channel.d.ts.map +1 -1
- package/dist/dts/Chunk.d.ts +1 -4
- package/dist/dts/Chunk.d.ts.map +1 -1
- package/dist/dts/ConfigError.d.ts +7 -6
- package/dist/dts/ConfigError.d.ts.map +1 -1
- package/dist/dts/Cron.d.ts +0 -5
- package/dist/dts/Cron.d.ts.map +1 -1
- package/dist/dts/Duration.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts +38 -33
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Either.d.ts +5 -2
- package/dist/dts/Either.d.ts.map +1 -1
- package/dist/dts/Encoding.d.ts.map +1 -1
- package/dist/dts/Equivalence.d.ts.map +1 -1
- package/dist/dts/ExecutionStrategy.d.ts +10 -2
- package/dist/dts/ExecutionStrategy.d.ts.map +1 -1
- package/dist/dts/Exit.d.ts +4 -3
- package/dist/dts/Exit.d.ts.map +1 -1
- package/dist/dts/Fiber.d.ts +4 -2
- package/dist/dts/Fiber.d.ts.map +1 -1
- package/dist/dts/FiberHandle.d.ts +189 -0
- package/dist/dts/FiberHandle.d.ts.map +1 -0
- package/dist/dts/FiberMap.d.ts +48 -12
- package/dist/dts/FiberMap.d.ts.map +1 -1
- package/dist/dts/FiberRefs.d.ts +1 -1
- package/dist/dts/FiberRefs.d.ts.map +1 -1
- package/dist/dts/FiberSet.d.ts +9 -5
- package/dist/dts/FiberSet.d.ts.map +1 -1
- package/dist/dts/Function.d.ts.map +1 -1
- package/dist/dts/GroupBy.d.ts +1 -1
- package/dist/dts/GroupBy.d.ts.map +1 -1
- package/dist/dts/HashMap.d.ts +0 -1
- package/dist/dts/HashMap.d.ts.map +1 -1
- package/dist/dts/HashSet.d.ts +0 -1
- package/dist/dts/HashSet.d.ts.map +1 -1
- package/dist/dts/Iterable.d.ts +12 -5
- package/dist/dts/Iterable.d.ts.map +1 -1
- package/dist/dts/Layer.d.ts +6 -6
- package/dist/dts/Layer.d.ts.map +1 -1
- package/dist/dts/List.d.ts +0 -11
- package/dist/dts/List.d.ts.map +1 -1
- package/dist/dts/Logger.d.ts +2 -2
- package/dist/dts/Logger.d.ts.map +1 -1
- package/dist/dts/Metric.d.ts +7 -2
- package/dist/dts/Metric.d.ts.map +1 -1
- package/dist/dts/MetricKey.d.ts +4 -1
- package/dist/dts/MetricKey.d.ts.map +1 -1
- package/dist/dts/MetricKeyType.d.ts +4 -1
- package/dist/dts/MetricKeyType.d.ts.map +1 -1
- package/dist/dts/MutableHashMap.d.ts.map +1 -1
- package/dist/dts/Option.d.ts +5 -3
- package/dist/dts/Option.d.ts.map +1 -1
- package/dist/dts/Order.d.ts.map +1 -1
- package/dist/dts/{ReadonlyRecord.d.ts → Record.d.ts} +29 -30
- package/dist/dts/Record.d.ts.map +1 -0
- package/dist/dts/Request.d.ts +1 -1
- package/dist/dts/Request.d.ts.map +1 -1
- package/dist/dts/RequestResolver.d.ts +2 -2
- package/dist/dts/RequestResolver.d.ts.map +1 -1
- package/dist/dts/STM.d.ts +6 -4
- package/dist/dts/STM.d.ts.map +1 -1
- package/dist/dts/Schedule.d.ts +1 -1
- package/dist/dts/Scheduler.d.ts.map +1 -1
- package/dist/dts/ScopedCache.d.ts +9 -9
- package/dist/dts/ScopedCache.d.ts.map +1 -1
- package/dist/dts/SortedMap.d.ts.map +1 -1
- package/dist/dts/SortedSet.d.ts +1 -1
- package/dist/dts/SortedSet.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +8 -6
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/StreamHaltStrategy.d.ts +14 -2
- package/dist/dts/StreamHaltStrategy.d.ts.map +1 -1
- package/dist/dts/String.d.ts +25 -1
- package/dist/dts/String.d.ts.map +1 -1
- package/dist/dts/Subscribable.d.ts.map +1 -1
- package/dist/dts/TestAnnotation.d.ts.map +1 -1
- package/dist/dts/TestAnnotationMap.d.ts.map +1 -1
- package/dist/dts/TestAnnotations.d.ts +0 -3
- package/dist/dts/TestAnnotations.d.ts.map +1 -1
- package/dist/dts/TestClock.d.ts.map +1 -1
- package/dist/dts/TestLive.d.ts.map +1 -1
- package/dist/dts/TestServices.d.ts.map +1 -1
- package/dist/dts/TestSized.d.ts.map +1 -1
- package/dist/dts/Tracer.d.ts +12 -5
- package/dist/dts/Tracer.d.ts.map +1 -1
- package/dist/dts/Trie.d.ts +1 -1
- package/dist/dts/Trie.d.ts.map +1 -1
- package/dist/dts/Types.d.ts +0 -7
- package/dist/dts/Types.d.ts.map +1 -1
- package/dist/dts/index.d.ts +11 -7
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/internal/array.d.ts +5 -0
- package/dist/dts/internal/array.d.ts.map +1 -0
- package/dist/dts/internal/core-stream.d.ts +4 -0
- package/dist/dts/internal/core-stream.d.ts.map +1 -1
- package/dist/dts/internal/core.d.ts +3 -1
- package/dist/dts/internal/core.d.ts.map +1 -1
- package/dist/dts/internal/fiber.d.ts +5 -1
- package/dist/dts/internal/fiber.d.ts.map +1 -1
- package/dist/dts/internal/hashMap.d.ts.map +1 -1
- package/dist/dts/internal/logger.d.ts.map +1 -1
- package/dist/dts/internal/metric/keyType.d.ts +3 -1
- package/dist/dts/internal/metric/keyType.d.ts.map +1 -1
- package/dist/dts/internal/metric/state.d.ts.map +1 -1
- package/dist/dts/internal/random.d.ts.map +1 -1
- package/dist/dts/internal/runtimeFlags.d.ts.map +1 -1
- package/dist/dts/internal/stm/stm/tExit.d.ts +4 -1
- package/dist/dts/internal/stm/stm/tExit.d.ts.map +1 -1
- package/dist/dts/internal/stm/stm.d.ts +3 -0
- package/dist/dts/internal/stm/stm.d.ts.map +1 -1
- package/dist/dts/internal/stream.d.ts +5 -1
- package/dist/dts/internal/stream.d.ts.map +1 -1
- package/dist/esm/{ReadonlyArray.js → Array.js} +42 -20
- package/dist/esm/Array.js.map +1 -0
- package/dist/esm/Brand.js +2 -2
- package/dist/esm/Brand.js.map +1 -1
- package/dist/esm/Channel.js +4 -2
- package/dist/esm/Channel.js.map +1 -1
- package/dist/esm/Chunk.js +4 -1
- package/dist/esm/Chunk.js.map +1 -1
- package/dist/esm/ConfigError.js.map +1 -1
- package/dist/esm/Cron.js +13 -13
- package/dist/esm/Cron.js.map +1 -1
- package/dist/esm/Effect.js +11 -2
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Either.js +4 -1
- package/dist/esm/Either.js.map +1 -1
- package/dist/esm/ExecutionStrategy.js.map +1 -1
- package/dist/esm/Exit.js +4 -2
- package/dist/esm/Exit.js.map +1 -1
- package/dist/esm/Fiber.js +3 -1
- package/dist/esm/Fiber.js.map +1 -1
- package/dist/esm/FiberHandle.js +247 -0
- package/dist/esm/FiberHandle.js.map +1 -0
- package/dist/esm/FiberMap.js +85 -26
- package/dist/esm/FiberMap.js.map +1 -1
- package/dist/esm/FiberRefs.js.map +1 -1
- package/dist/esm/FiberSet.js +51 -15
- package/dist/esm/FiberSet.js.map +1 -1
- package/dist/esm/HashMap.js.map +1 -1
- package/dist/esm/HashSet.js.map +1 -1
- package/dist/esm/Iterable.js +39 -4
- package/dist/esm/Iterable.js.map +1 -1
- package/dist/esm/Layer.js.map +1 -1
- package/dist/esm/List.js +3 -3
- package/dist/esm/List.js.map +1 -1
- package/dist/esm/Metric.js +3 -1
- package/dist/esm/Metric.js.map +1 -1
- package/dist/esm/MetricKey.js.map +1 -1
- package/dist/esm/MetricKeyType.js.map +1 -1
- package/dist/esm/MutableHashMap.js +0 -3
- package/dist/esm/MutableHashMap.js.map +1 -1
- package/dist/esm/Option.js +4 -2
- package/dist/esm/Option.js.map +1 -1
- package/dist/esm/{ReadonlyRecord.js → Record.js} +29 -29
- package/dist/esm/Record.js.map +1 -0
- package/dist/esm/STM.js +5 -3
- package/dist/esm/STM.js.map +1 -1
- package/dist/esm/Schedule.js +1 -1
- package/dist/esm/Schedule.js.map +1 -1
- package/dist/esm/ScopedCache.js.map +1 -1
- package/dist/esm/Stream.js +5 -3
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/StreamHaltStrategy.js +2 -0
- package/dist/esm/StreamHaltStrategy.js.map +1 -1
- package/dist/esm/String.js +37 -1
- package/dist/esm/String.js.map +1 -1
- package/dist/esm/TestAnnotations.js +1 -1
- package/dist/esm/TestAnnotations.js.map +1 -1
- package/dist/esm/TestClock.js +3 -3
- package/dist/esm/TestClock.js.map +1 -1
- package/dist/esm/Tracer.js.map +1 -1
- package/dist/esm/index.js +11 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/{readonlyArray.js → array.js} +1 -1
- package/dist/esm/internal/array.js.map +1 -0
- package/dist/esm/internal/cache.js +3 -3
- package/dist/esm/internal/cache.js.map +1 -1
- package/dist/esm/internal/cause.js +3 -3
- package/dist/esm/internal/cause.js.map +1 -1
- package/dist/esm/internal/channel/channelExecutor.js +15 -15
- package/dist/esm/internal/channel/channelExecutor.js.map +1 -1
- package/dist/esm/internal/channel/channelState.js +1 -1
- package/dist/esm/internal/channel/channelState.js.map +1 -1
- package/dist/esm/internal/channel/singleProducerAsyncInput.js +1 -1
- package/dist/esm/internal/channel/singleProducerAsyncInput.js.map +1 -1
- package/dist/esm/internal/channel.js +8 -8
- package/dist/esm/internal/channel.js.map +1 -1
- package/dist/esm/internal/clock.js +2 -2
- package/dist/esm/internal/clock.js.map +1 -1
- package/dist/esm/internal/configError.js +20 -19
- package/dist/esm/internal/configError.js.map +1 -1
- package/dist/esm/internal/configProvider/pathPatch.js +1 -1
- package/dist/esm/internal/configProvider/pathPatch.js.map +1 -1
- package/dist/esm/internal/configProvider.js +46 -47
- package/dist/esm/internal/configProvider.js.map +1 -1
- package/dist/esm/internal/core-effect.js +39 -26
- package/dist/esm/internal/core-effect.js.map +1 -1
- package/dist/esm/internal/core-stream.js +3 -2
- package/dist/esm/internal/core-stream.js.map +1 -1
- package/dist/esm/internal/core.js +24 -26
- package/dist/esm/internal/core.js.map +1 -1
- package/dist/esm/internal/dataSource.js +19 -2
- package/dist/esm/internal/dataSource.js.map +1 -1
- package/dist/esm/internal/differ/readonlyArrayPatch.js +6 -6
- package/dist/esm/internal/differ/readonlyArrayPatch.js.map +1 -1
- package/dist/esm/internal/effect/circular.js +1 -1
- package/dist/esm/internal/effect/circular.js.map +1 -1
- package/dist/esm/internal/executionStrategy.js +4 -4
- package/dist/esm/internal/executionStrategy.js.map +1 -1
- package/dist/esm/internal/fiber.js +6 -5
- package/dist/esm/internal/fiber.js.map +1 -1
- package/dist/esm/internal/fiberRefs/patch.js +1 -1
- package/dist/esm/internal/fiberRefs/patch.js.map +1 -1
- package/dist/esm/internal/fiberRefs.js +1 -1
- package/dist/esm/internal/fiberRefs.js.map +1 -1
- package/dist/esm/internal/fiberRuntime.js +33 -33
- package/dist/esm/internal/fiberRuntime.js.map +1 -1
- package/dist/esm/internal/groupBy.js +3 -3
- package/dist/esm/internal/groupBy.js.map +1 -1
- package/dist/esm/internal/hashMap.js.map +1 -1
- package/dist/esm/internal/hashSet.js.map +1 -1
- package/dist/esm/internal/layer/circular.js.map +1 -1
- package/dist/esm/internal/layer.js +5 -5
- package/dist/esm/internal/layer.js.map +1 -1
- package/dist/esm/internal/logger.js +28 -8
- package/dist/esm/internal/logger.js.map +1 -1
- package/dist/esm/internal/managedRuntime.js +1 -1
- package/dist/esm/internal/managedRuntime.js.map +1 -1
- package/dist/esm/internal/metric/boundaries.js +4 -4
- package/dist/esm/internal/metric/boundaries.js.map +1 -1
- package/dist/esm/internal/metric/hook.js +20 -17
- package/dist/esm/internal/metric/hook.js.map +1 -1
- package/dist/esm/internal/metric/key.js +4 -4
- package/dist/esm/internal/metric/key.js.map +1 -1
- package/dist/esm/internal/metric/keyType.js +5 -1
- package/dist/esm/internal/metric/keyType.js.map +1 -1
- package/dist/esm/internal/metric/state.js +4 -4
- package/dist/esm/internal/metric/state.js.map +1 -1
- package/dist/esm/internal/metric.js +4 -4
- package/dist/esm/internal/metric.js.map +1 -1
- package/dist/esm/internal/pool.js +11 -11
- package/dist/esm/internal/pool.js.map +1 -1
- package/dist/esm/internal/pubsub.js +5 -5
- package/dist/esm/internal/pubsub.js.map +1 -1
- package/dist/esm/internal/query.js +2 -2
- package/dist/esm/internal/query.js.map +1 -1
- package/dist/esm/internal/queue.js +9 -9
- package/dist/esm/internal/queue.js.map +1 -1
- package/dist/esm/internal/rateLimiter.js +1 -1
- package/dist/esm/internal/rateLimiter.js.map +1 -1
- package/dist/esm/internal/redBlackTree/iterator.js +2 -2
- package/dist/esm/internal/redBlackTree/iterator.js.map +1 -1
- package/dist/esm/internal/reloadable.js +1 -1
- package/dist/esm/internal/reloadable.js.map +1 -1
- package/dist/esm/internal/runtime.js +4 -4
- package/dist/esm/internal/runtime.js.map +1 -1
- package/dist/esm/internal/schedule.js +3 -3
- package/dist/esm/internal/schedule.js.map +1 -1
- package/dist/esm/internal/scopedCache.js +7 -7
- package/dist/esm/internal/scopedCache.js.map +1 -1
- package/dist/esm/internal/scopedRef.js +4 -4
- package/dist/esm/internal/scopedRef.js.map +1 -1
- package/dist/esm/internal/secret.js +2 -2
- package/dist/esm/internal/secret.js.map +1 -1
- package/dist/esm/internal/sink.js +10 -10
- package/dist/esm/internal/sink.js.map +1 -1
- package/dist/esm/internal/stm/stm/tExit.js +3 -2
- package/dist/esm/internal/stm/stm/tExit.js.map +1 -1
- package/dist/esm/internal/stm/stm.js +11 -9
- package/dist/esm/internal/stm/stm.js.map +1 -1
- package/dist/esm/internal/stm/tMap.js +3 -3
- package/dist/esm/internal/stm/tMap.js.map +1 -1
- package/dist/esm/internal/stm/tPriorityQueue.js +11 -11
- package/dist/esm/internal/stm/tPriorityQueue.js.map +1 -1
- package/dist/esm/internal/stm/tPubSub.js +3 -3
- package/dist/esm/internal/stm/tPubSub.js.map +1 -1
- package/dist/esm/internal/stm/tQueue.js +3 -3
- package/dist/esm/internal/stm/tQueue.js.map +1 -1
- package/dist/esm/internal/stm/tSet.js +1 -1
- package/dist/esm/internal/stm/tSet.js.map +1 -1
- package/dist/esm/internal/stream/haltStrategy.js +5 -5
- package/dist/esm/internal/stream/haltStrategy.js.map +1 -1
- package/dist/esm/internal/stream.js +85 -84
- package/dist/esm/internal/stream.js.map +1 -1
- package/dist/esm/internal/supervisor.js +1 -1
- package/dist/esm/internal/supervisor.js.map +1 -1
- package/dist/esm/internal/take.js +1 -1
- package/dist/esm/internal/take.js.map +1 -1
- package/dist/esm/internal/tracer.js.map +1 -1
- package/dist/esm/internal/trie.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/dist/esm/internal/version.js.map +1 -1
- package/package.json +23 -15
- package/src/{ReadonlyArray.ts → Array.ts} +47 -24
- package/src/Brand.ts +3 -3
- package/src/Cache.ts +12 -10
- package/src/Cause.ts +1 -1
- package/src/Channel.ts +12 -9
- package/src/Chunk.ts +3 -3
- package/src/ConfigError.ts +7 -6
- package/src/Cron.ts +17 -17
- package/src/Effect.ts +46 -57
- package/src/Either.ts +7 -7
- package/src/ExecutionStrategy.ts +10 -2
- package/src/Exit.ts +11 -9
- package/src/Fiber.ts +11 -8
- package/src/FiberHandle.ts +414 -0
- package/src/FiberMap.ts +181 -73
- package/src/FiberRefs.ts +1 -1
- package/src/FiberSet.ts +96 -36
- package/src/GroupBy.ts +1 -1
- package/src/HashMap.ts +0 -1
- package/src/HashSet.ts +0 -1
- package/src/Iterable.ts +48 -10
- package/src/Layer.ts +6 -6
- package/src/List.ts +3 -4
- package/src/Logger.ts +2 -2
- package/src/Metric.ts +9 -2
- package/src/MetricKey.ts +9 -1
- package/src/MetricKeyType.ts +6 -1
- package/src/MutableHashMap.ts +1 -1
- package/src/Option.ts +9 -6
- package/src/{ReadonlyRecord.ts → Record.ts} +28 -29
- package/src/Request.ts +1 -1
- package/src/RequestResolver.ts +4 -4
- package/src/STM.ts +12 -9
- package/src/Schedule.ts +1 -1
- package/src/ScopedCache.ts +11 -9
- package/src/SortedSet.ts +1 -1
- package/src/Stream.ts +14 -11
- package/src/StreamHaltStrategy.ts +14 -2
- package/src/String.ts +45 -2
- package/src/TestAnnotations.ts +1 -1
- package/src/TestClock.ts +3 -3
- package/src/Tracer.ts +13 -5
- package/src/Trie.ts +1 -1
- package/src/Types.ts +0 -8
- package/src/index.ts +13 -8
- package/src/internal/{readonlyArray.ts → array.ts} +1 -1
- package/src/internal/cache.ts +40 -40
- package/src/internal/cause.ts +5 -6
- package/src/internal/channel/channelExecutor.ts +15 -15
- package/src/internal/channel/channelState.ts +1 -1
- package/src/internal/channel/singleProducerAsyncInput.ts +1 -1
- package/src/internal/channel.ts +11 -11
- package/src/internal/clock.ts +2 -2
- package/src/internal/configError.ts +22 -21
- package/src/internal/configProvider/pathPatch.ts +1 -1
- package/src/internal/configProvider.ts +49 -52
- package/src/internal/core-effect.ts +73 -70
- package/src/internal/core-stream.ts +5 -2
- package/src/internal/core.ts +51 -50
- package/src/internal/dataSource.ts +19 -20
- package/src/internal/differ/readonlyArrayPatch.ts +6 -6
- package/src/internal/effect/circular.ts +2 -2
- package/src/internal/executionStrategy.ts +14 -12
- package/src/internal/fiber.ts +8 -5
- package/src/internal/fiberRefs/patch.ts +1 -1
- package/src/internal/fiberRefs.ts +1 -1
- package/src/internal/fiberRuntime.ts +45 -45
- package/src/internal/groupBy.ts +4 -4
- package/src/internal/hashMap.ts +0 -1
- package/src/internal/hashSet.ts +0 -1
- package/src/internal/layer/circular.ts +2 -2
- package/src/internal/layer.ts +9 -9
- package/src/internal/logger.ts +28 -8
- package/src/internal/managedRuntime.ts +1 -1
- package/src/internal/metric/boundaries.ts +5 -5
- package/src/internal/metric/hook.ts +21 -18
- package/src/internal/metric/key.ts +8 -5
- package/src/internal/metric/keyType.ts +5 -2
- package/src/internal/metric/state.ts +5 -5
- package/src/internal/metric.ts +8 -6
- package/src/internal/pool.ts +11 -11
- package/src/internal/pubsub.ts +6 -6
- package/src/internal/query.ts +4 -4
- package/src/internal/queue.ts +11 -11
- package/src/internal/rateLimiter.ts +1 -1
- package/src/internal/redBlackTree/iterator.ts +2 -2
- package/src/internal/reloadable.ts +1 -1
- package/src/internal/runtime.ts +5 -5
- package/src/internal/schedule.ts +8 -9
- package/src/internal/scopedCache.ts +53 -53
- package/src/internal/scopedRef.ts +4 -4
- package/src/internal/secret.ts +2 -2
- package/src/internal/sink.ts +10 -10
- package/src/internal/stm/stm/tExit.ts +5 -2
- package/src/internal/stm/stm.ts +13 -9
- package/src/internal/stm/tMap.ts +3 -3
- package/src/internal/stm/tPriorityQueue.ts +11 -11
- package/src/internal/stm/tPubSub.ts +3 -3
- package/src/internal/stm/tQueue.ts +3 -3
- package/src/internal/stm/tSet.ts +1 -1
- package/src/internal/stream/haltStrategy.ts +23 -14
- package/src/internal/stream.ts +91 -88
- package/src/internal/supervisor.ts +1 -1
- package/src/internal/take.ts +1 -1
- package/src/internal/tracer.ts +2 -2
- package/src/internal/trie.ts +0 -1
- package/src/internal/version.ts +1 -1
- package/ReadonlyArray/package.json +0 -6
- package/ReadonlyRecord/package.json +0 -6
- package/dist/cjs/ReadonlyArray.js.map +0 -1
- package/dist/cjs/ReadonlyRecord.js.map +0 -1
- package/dist/cjs/internal/Iterable.js +0 -61
- package/dist/cjs/internal/Iterable.js.map +0 -1
- package/dist/cjs/internal/readonlyArray.js.map +0 -1
- package/dist/dts/ReadonlyArray.d.ts.map +0 -1
- package/dist/dts/ReadonlyRecord.d.ts.map +0 -1
- package/dist/dts/internal/Iterable.d.ts +0 -2
- package/dist/dts/internal/Iterable.d.ts.map +0 -1
- package/dist/dts/internal/readonlyArray.d.ts +0 -5
- package/dist/dts/internal/readonlyArray.d.ts.map +0 -1
- package/dist/esm/ReadonlyArray.js.map +0 -1
- package/dist/esm/ReadonlyRecord.js.map +0 -1
- package/dist/esm/internal/Iterable.js +0 -53
- package/dist/esm/internal/Iterable.js.map +0 -1
- package/dist/esm/internal/readonlyArray.js.map +0 -1
- package/src/internal/Iterable.ts +0 -54
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
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
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.
|
|
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.void = exports.updateService = exports.unwrapScoped = exports.unwrap = 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"));
|
|
@@ -111,7 +111,7 @@ const accumulateChunks = self => {
|
|
|
111
111
|
return core.flatMap(core.write(next), () => accumulator(next));
|
|
112
112
|
},
|
|
113
113
|
onFailure: core.fail,
|
|
114
|
-
onDone: () => core.
|
|
114
|
+
onDone: () => core.void
|
|
115
115
|
});
|
|
116
116
|
return new StreamImpl(core.pipeTo(toChannel(self), accumulator(Chunk.empty())));
|
|
117
117
|
};
|
|
@@ -143,7 +143,7 @@ const aggregateWithinEither = exports.aggregateWithinEither = /*#__PURE__*/(0, _
|
|
|
143
143
|
switch (signal._tag) {
|
|
144
144
|
case HandoffSignal.OP_EMIT:
|
|
145
145
|
{
|
|
146
|
-
return (0, _Function.pipe)(core.fromEffect(Ref.set(consumed, true)), channel.zipRight(core.write(signal.elements)), channel.zipRight(core.fromEffect(Ref.get(endAfterEmit))), core.flatMap(bool => bool ? core.
|
|
146
|
+
return (0, _Function.pipe)(core.fromEffect(Ref.set(consumed, true)), channel.zipRight(core.write(signal.elements)), channel.zipRight(core.fromEffect(Ref.get(endAfterEmit))), core.flatMap(bool => bool ? core.void : handoffConsumer));
|
|
147
147
|
}
|
|
148
148
|
case HandoffSignal.OP_HALT:
|
|
149
149
|
{
|
|
@@ -179,7 +179,7 @@ const aggregateWithinEither = exports.aggregateWithinEither = /*#__PURE__*/(0, _
|
|
|
179
179
|
}
|
|
180
180
|
case SinkEndReason.OP_UPSTREAM_END:
|
|
181
181
|
{
|
|
182
|
-
return (0, _Function.pipe)(Ref.get(consumed), Effect.map(wasConsumed => wasConsumed ? core.write(Chunk.of(Either.right(b))) : core.
|
|
182
|
+
return (0, _Function.pipe)(Ref.get(consumed), Effect.map(wasConsumed => wasConsumed ? core.write(Chunk.of(Either.right(b))) : core.void), channel.unwrap);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
})), channel.unwrap);
|
|
@@ -202,7 +202,7 @@ const as = exports.as = /*#__PURE__*/(0, _Function.dual)(2, (self, value) => map
|
|
|
202
202
|
/** @internal */
|
|
203
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
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.
|
|
205
|
+
const canceler = register(emit.make(resume => InternalTake.fromPull(resume).pipe(Effect.flatMap(take => Queue.offer(output, take)), Effect.asVoid, runPromiseExit).then(exit => {
|
|
206
206
|
if (Exit.isFailure(exit)) {
|
|
207
207
|
if (!Cause.isInterrupted(exit.cause)) {
|
|
208
208
|
throw Cause.squash(exit.cause);
|
|
@@ -213,16 +213,16 @@ const _async = (register, outputBuffer = 16) => Effect.acquireRelease(Queue.boun
|
|
|
213
213
|
})), Effect.map(value => {
|
|
214
214
|
const loop = Queue.take(output).pipe(Effect.flatMap(take => InternalTake.done(take)), Effect.match({
|
|
215
215
|
onFailure: maybeError => core.fromEffect(Queue.shutdown(output)).pipe(channel.zipRight(Option.match(maybeError, {
|
|
216
|
-
onNone: () => core.
|
|
216
|
+
onNone: () => core.void,
|
|
217
217
|
onSome: error => core.fail(error)
|
|
218
218
|
}))),
|
|
219
219
|
onSuccess: chunk => core.write(chunk).pipe(core.flatMap(() => loop))
|
|
220
220
|
}), channel.unwrap);
|
|
221
|
-
return fromChannel(loop).pipe(ensuring(value ?? Effect.
|
|
221
|
+
return fromChannel(loop).pipe(ensuring(value ?? Effect.void));
|
|
222
222
|
}))), unwrapScoped);
|
|
223
223
|
/** @internal */
|
|
224
224
|
exports._async = _async;
|
|
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.
|
|
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.asVoid, Runtime.runPromiseExit(runtime)).then(exit => {
|
|
226
226
|
if (Exit.isFailure(exit)) {
|
|
227
227
|
if (!Cause.isInterrupted(exit.cause)) {
|
|
228
228
|
throw Cause.squash(exit.cause);
|
|
@@ -231,7 +231,7 @@ const asyncEffect = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.
|
|
|
231
231
|
}))), Effect.map(() => {
|
|
232
232
|
const loop = (0, _Function.pipe)(Queue.take(output), Effect.flatMap(InternalTake.done), Effect.match({
|
|
233
233
|
onFailure: maybeError => (0, _Function.pipe)(core.fromEffect(Queue.shutdown(output)), channel.zipRight(Option.match(maybeError, {
|
|
234
|
-
onNone: () => core.
|
|
234
|
+
onNone: () => core.void,
|
|
235
235
|
onSome: core.fail
|
|
236
236
|
}))),
|
|
237
237
|
onSuccess: chunk => (0, _Function.pipe)(core.write(chunk), core.flatMap(() => loop))
|
|
@@ -240,7 +240,7 @@ const asyncEffect = (register, outputBuffer = 16) => (0, _Function.pipe)(Effect.
|
|
|
240
240
|
}))))), channel.unwrapScoped, fromChannel);
|
|
241
241
|
/** @internal */
|
|
242
242
|
exports.asyncEffect = asyncEffect;
|
|
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.
|
|
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.asVoid, Runtime.runPromiseExit(runtime)).then(exit => {
|
|
244
244
|
if (Exit.isFailure(exit)) {
|
|
245
245
|
if (!Cause.isInterrupted(exit.cause)) {
|
|
246
246
|
throw Cause.squash(exit.cause);
|
|
@@ -290,7 +290,7 @@ const buffer = exports.buffer = /*#__PURE__*/(0, _Function.dual)(2, (self, optio
|
|
|
290
290
|
return new StreamImpl(channel.unwrapScoped(Effect.map(queue, queue => {
|
|
291
291
|
const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(Exit.match({
|
|
292
292
|
onFailure: cause => (0, _Function.pipe)(Cause.flipCauseOption(cause), Option.match({
|
|
293
|
-
onNone: () => core.
|
|
293
|
+
onNone: () => core.void,
|
|
294
294
|
onSome: core.failCause
|
|
295
295
|
})),
|
|
296
296
|
onSuccess: value => core.flatMap(core.write(Chunk.of(value)), () => process)
|
|
@@ -308,7 +308,7 @@ const bufferChunks = exports.bufferChunks = /*#__PURE__*/(0, _Function.dual)(2,
|
|
|
308
308
|
const queue = toQueue(self, options);
|
|
309
309
|
return new StreamImpl(channel.unwrapScoped(Effect.map(queue, queue => {
|
|
310
310
|
const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(InternalTake.match({
|
|
311
|
-
onEnd: () => core.
|
|
311
|
+
onEnd: () => core.void,
|
|
312
312
|
onFailure: core.failCause,
|
|
313
313
|
onSuccess: value => (0, _Function.pipe)(core.write(value), core.flatMap(() => process))
|
|
314
314
|
})));
|
|
@@ -337,7 +337,7 @@ const bufferUnbounded = self => {
|
|
|
337
337
|
});
|
|
338
338
|
return new StreamImpl(channel.unwrapScoped(Effect.map(queue, queue => {
|
|
339
339
|
const process = (0, _Function.pipe)(core.fromEffect(Queue.take(queue)), core.flatMap(InternalTake.match({
|
|
340
|
-
onEnd: () => core.
|
|
340
|
+
onEnd: () => core.void,
|
|
341
341
|
onFailure: core.failCause,
|
|
342
342
|
onSuccess: value => core.flatMap(core.write(value), () => process)
|
|
343
343
|
})));
|
|
@@ -346,16 +346,16 @@ const bufferUnbounded = self => {
|
|
|
346
346
|
};
|
|
347
347
|
const bufferSignal = (scoped, bufferChannel) => {
|
|
348
348
|
const producer = (queue, ref) => {
|
|
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.
|
|
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.asVoid, core.fromEffect);
|
|
350
350
|
return core.readWithCause({
|
|
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.
|
|
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.asVoid, core.fromEffect, core.flatMap(() => producer(queue, ref))),
|
|
352
352
|
onFailure: error => terminate(InternalTake.failCause(error)),
|
|
353
353
|
onDone: () => terminate(InternalTake.end)
|
|
354
354
|
});
|
|
355
355
|
};
|
|
356
356
|
const consumer = queue => {
|
|
357
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, {
|
|
358
|
-
onEnd: () => core.
|
|
358
|
+
onEnd: () => core.void,
|
|
359
359
|
onFailure: core.failCause,
|
|
360
360
|
onSuccess: value => (0, _Function.pipe)(core.write(value), core.flatMap(() => process))
|
|
361
361
|
}))));
|
|
@@ -405,7 +405,7 @@ const changesWith = exports.changesWith = /*#__PURE__*/(0, _Function.dual)(2, (s
|
|
|
405
405
|
return core.flatMap(core.write(newChunk), () => writer(newLast));
|
|
406
406
|
},
|
|
407
407
|
onFailure: core.failCause,
|
|
408
|
-
onDone: () => core.
|
|
408
|
+
onDone: () => core.void
|
|
409
409
|
});
|
|
410
410
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), core.pipeTo(writer(Option.none()))));
|
|
411
411
|
});
|
|
@@ -419,7 +419,7 @@ const changesWithEffect = exports.changesWithEffect = /*#__PURE__*/(0, _Function
|
|
|
419
419
|
return Effect.succeed([Option.some(output), (0, _Function.pipe)(outputs, Chunk.append(output))]);
|
|
420
420
|
}), core.fromEffect, core.flatMap(([newLast, newChunk]) => (0, _Function.pipe)(core.write(newChunk), core.flatMap(() => writer(newLast))))),
|
|
421
421
|
onFailure: core.failCause,
|
|
422
|
-
onDone: () => core.
|
|
422
|
+
onDone: () => core.void
|
|
423
423
|
});
|
|
424
424
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), core.pipeTo(writer(Option.none()))));
|
|
425
425
|
});
|
|
@@ -505,7 +505,7 @@ const debounce = exports.debounce = /*#__PURE__*/(0, _Function.dual)(2, (self, d
|
|
|
505
505
|
}
|
|
506
506
|
case HandoffSignal.OP_END:
|
|
507
507
|
{
|
|
508
|
-
return core.
|
|
508
|
+
return core.void;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
}), channel.unwrap);
|
|
@@ -531,7 +531,7 @@ const debounce = exports.debounce = /*#__PURE__*/(0, _Function.dual)(2, (self, d
|
|
|
531
531
|
}
|
|
532
532
|
case HandoffSignal.OP_END:
|
|
533
533
|
{
|
|
534
|
-
return (0, _Function.pipe)(Fiber.join(previous), Effect.map(chunk => (0, _Function.pipe)(core.write(chunk), channel.zipRight(core.
|
|
534
|
+
return (0, _Function.pipe)(Fiber.join(previous), Effect.map(chunk => (0, _Function.pipe)(core.write(chunk), channel.zipRight(core.void))));
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
}
|
|
@@ -552,7 +552,7 @@ const debounce = exports.debounce = /*#__PURE__*/(0, _Function.dual)(2, (self, d
|
|
|
552
552
|
}
|
|
553
553
|
case HandoffSignal.OP_END:
|
|
554
554
|
{
|
|
555
|
-
return core.
|
|
555
|
+
return core.void;
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
}), channel.unwrap);
|
|
@@ -589,7 +589,7 @@ const newDistributedWithDynamicId = () => {
|
|
|
589
589
|
return current;
|
|
590
590
|
};
|
|
591
591
|
/** @internal */
|
|
592
|
-
const distributedWithDynamic = exports.distributedWithDynamic = /*#__PURE__*/(0, _Function.dual)(2, (self, options) => distributedWithDynamicCallback(self, options.maximumLag, options.decide, () => Effect.
|
|
592
|
+
const distributedWithDynamic = exports.distributedWithDynamic = /*#__PURE__*/(0, _Function.dual)(2, (self, options) => distributedWithDynamicCallback(self, options.maximumLag, options.decide, () => Effect.void));
|
|
593
593
|
/** @internal */
|
|
594
594
|
const distributedWithDynamicCallback = exports.distributedWithDynamicCallback = /*#__PURE__*/(0, _Function.dual)(4, (self, maximumLag, decide, done) => (0, _Function.pipe)(Effect.acquireRelease(Ref.make(new Map()), (ref, _) => (0, _Function.pipe)(Ref.get(ref), Effect.flatMap(queues => (0, _Function.pipe)(queues.values(), Effect.forEach(Queue.shutdown))))), Effect.flatMap(queuesRef => Effect.gen(function* ($) {
|
|
595
595
|
const offer = a => (0, _Function.pipe)(decide(a), Effect.flatMap(shouldProcess => (0, _Function.pipe)(Ref.get(queuesRef), Effect.flatMap(queues => (0, _Function.pipe)(queues.entries(), Effect.reduce(Chunk.empty(), (acc, [id, queue]) => {
|
|
@@ -612,8 +612,8 @@ const distributedWithDynamicCallback = exports.distributedWithDynamicCallback =
|
|
|
612
612
|
return map;
|
|
613
613
|
}));
|
|
614
614
|
}
|
|
615
|
-
return Effect.
|
|
616
|
-
}))))), Effect.
|
|
615
|
+
return Effect.void;
|
|
616
|
+
}))))), Effect.asVoid);
|
|
617
617
|
const queuesLock = yield* $(Effect.makeSemaphore(1));
|
|
618
618
|
const newQueue = yield* $(Ref.make((0, _Function.pipe)(Queue.bounded(maximumLag), Effect.flatMap(queue => {
|
|
619
619
|
const id = newDistributedWithDynamicId();
|
|
@@ -626,7 +626,7 @@ const distributedWithDynamicCallback = exports.distributedWithDynamicCallback =
|
|
|
626
626
|
Queue.bounded(1), Effect.tap(queue => Queue.offer(queue, endTake)), Effect.flatMap(queue => {
|
|
627
627
|
const id = newDistributedWithDynamicId();
|
|
628
628
|
return (0, _Function.pipe)(Ref.update(queuesRef, map => map.set(id, queue)), Effect.as(Tuple.make(id, queue)));
|
|
629
|
-
}))), Effect.zipRight((0, _Function.pipe)(Ref.get(queuesRef), Effect.flatMap(map => (0, _Function.pipe)(Chunk.fromIterable(map.values()), Effect.forEach(queue => (0, _Function.pipe)(Queue.offer(queue, endTake), Effect.catchSomeCause(cause => Cause.isInterrupted(cause) ? Option.some(Effect.
|
|
629
|
+
}))), Effect.zipRight((0, _Function.pipe)(Ref.get(queuesRef), Effect.flatMap(map => (0, _Function.pipe)(Chunk.fromIterable(map.values()), Effect.forEach(queue => (0, _Function.pipe)(Queue.offer(queue, endTake), Effect.catchSomeCause(cause => Cause.isInterrupted(cause) ? Option.some(Effect.void) : Option.none()))))))), Effect.zipRight(done(endTake)), Effect.asVoid));
|
|
630
630
|
yield* $(self, runForEachScoped(offer), Effect.matchCauseEffect({
|
|
631
631
|
onFailure: cause => finalize(Exit.failCause((0, _Function.pipe)(cause, Cause.map(Option.some)))),
|
|
632
632
|
onSuccess: () => finalize(Exit.fail(Option.none()))
|
|
@@ -637,7 +637,7 @@ const distributedWithDynamicCallback = exports.distributedWithDynamicCallback =
|
|
|
637
637
|
const drain = self => new StreamImpl(channel.drain(toChannel(self)));
|
|
638
638
|
/** @internal */
|
|
639
639
|
exports.drain = drain;
|
|
640
|
-
const drainFork = exports.drainFork = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => (0, _Function.pipe)(fromEffect(Deferred.make()), flatMap(backgroundDied => (0, _Function.pipe)(scoped((0, _Function.pipe)(that, runForEachScoped(() => Effect.
|
|
640
|
+
const drainFork = exports.drainFork = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => (0, _Function.pipe)(fromEffect(Deferred.make()), flatMap(backgroundDied => (0, _Function.pipe)(scoped((0, _Function.pipe)(that, runForEachScoped(() => Effect.void), Effect.catchAllCause(cause => Deferred.failCause(backgroundDied, cause)), Effect.forkScoped)), crossRight((0, _Function.pipe)(self, interruptWhenDeferred(backgroundDied)))))));
|
|
641
641
|
/** @internal */
|
|
642
642
|
const drop = exports.drop = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
|
|
643
643
|
const loop = r => core.readWith({
|
|
@@ -651,7 +651,7 @@ const drop = exports.drop = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
|
|
|
651
651
|
return (0, _Function.pipe)(core.write(dropped), channel.zipRight(channel.identityChannel()));
|
|
652
652
|
},
|
|
653
653
|
onFailure: core.fail,
|
|
654
|
-
onDone: () => core.
|
|
654
|
+
onDone: () => core.void
|
|
655
655
|
});
|
|
656
656
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), channel.pipeToOrFail(loop(n))));
|
|
657
657
|
});
|
|
@@ -672,7 +672,7 @@ const dropRight = exports.dropRight = /*#__PURE__*/(0, _Function.dual)(2, (self,
|
|
|
672
672
|
return (0, _Function.pipe)(core.write(outputs), core.flatMap(() => reader));
|
|
673
673
|
},
|
|
674
674
|
onFailure: core.fail,
|
|
675
|
-
onDone: () => core.
|
|
675
|
+
onDone: () => core.void
|
|
676
676
|
});
|
|
677
677
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), channel.pipeToOrFail(reader)));
|
|
678
678
|
});
|
|
@@ -690,7 +690,7 @@ const dropUntilEffect = exports.dropUntilEffect = /*#__PURE__*/(0, _Function.dua
|
|
|
690
690
|
return (0, _Function.pipe)(core.write(leftover), channel.zipRight(channel.identityChannel()));
|
|
691
691
|
}), channel.unwrap),
|
|
692
692
|
onFailure: core.fail,
|
|
693
|
-
onDone: () => core.
|
|
693
|
+
onDone: () => core.void
|
|
694
694
|
});
|
|
695
695
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), channel.pipeToOrFail(loop)));
|
|
696
696
|
});
|
|
@@ -720,7 +720,7 @@ const dropWhileEffect = exports.dropWhileEffect = /*#__PURE__*/(0, _Function.dua
|
|
|
720
720
|
return channel.zipRight(core.write(leftover), channel.identityChannel());
|
|
721
721
|
}), channel.unwrap),
|
|
722
722
|
onFailure: core.fail,
|
|
723
|
-
onDone: () => core.
|
|
723
|
+
onDone: () => core.void
|
|
724
724
|
});
|
|
725
725
|
return new StreamImpl(channel.pipeToOrFail(toChannel(self), loop));
|
|
726
726
|
});
|
|
@@ -826,7 +826,7 @@ const filterMapWhileEffect = exports.filterMapWhileEffect = /*#__PURE__*/(0, _Fu
|
|
|
826
826
|
});
|
|
827
827
|
} else {
|
|
828
828
|
return channel.unwrap(Option.match(pf(next.value), {
|
|
829
|
-
onNone: () => Effect.succeed(core.
|
|
829
|
+
onNone: () => Effect.succeed(core.void),
|
|
830
830
|
onSome: Effect.map(a2 => core.flatMap(core.write(Chunk.of(a2)), () => loop(iterator)))
|
|
831
831
|
}));
|
|
832
832
|
}
|
|
@@ -834,7 +834,7 @@ const filterMapWhileEffect = exports.filterMapWhileEffect = /*#__PURE__*/(0, _Fu
|
|
|
834
834
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), channel.pipeToOrFail(loop(Chunk.empty()[Symbol.iterator]()))));
|
|
835
835
|
}));
|
|
836
836
|
/** @internal */
|
|
837
|
-
const finalizer = finalizer => acquireRelease(Effect.
|
|
837
|
+
const finalizer = finalizer => acquireRelease(Effect.void, () => finalizer);
|
|
838
838
|
/** @internal */
|
|
839
839
|
exports.finalizer = finalizer;
|
|
840
840
|
const find = exports.find = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate) => {
|
|
@@ -844,7 +844,7 @@ const find = exports.find = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate
|
|
|
844
844
|
onSome: n => core.write(Chunk.of(n))
|
|
845
845
|
}),
|
|
846
846
|
onFailure: core.fail,
|
|
847
|
-
onDone: () => core.
|
|
847
|
+
onDone: () => core.void
|
|
848
848
|
});
|
|
849
849
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), core.pipeTo(loop)));
|
|
850
850
|
});
|
|
@@ -856,7 +856,7 @@ const findEffect = exports.findEffect = /*#__PURE__*/(0, _Function.dual)(2, (sel
|
|
|
856
856
|
onSome: n => core.write(Chunk.of(n))
|
|
857
857
|
})), channel.unwrap),
|
|
858
858
|
onFailure: core.fail,
|
|
859
|
-
onDone: () => core.
|
|
859
|
+
onDone: () => core.void
|
|
860
860
|
});
|
|
861
861
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), core.pipeTo(loop)));
|
|
862
862
|
});
|
|
@@ -866,7 +866,7 @@ const flatMap = exports.flatMap = /*#__PURE__*/(0, _Function.dual)(args => isStr
|
|
|
866
866
|
if (options?.switch) {
|
|
867
867
|
return matchConcurrency(options?.concurrency, () => flatMapParSwitchBuffer(self, 1, bufferSize, f), n => flatMapParSwitchBuffer(self, n, bufferSize, f));
|
|
868
868
|
}
|
|
869
|
-
return matchConcurrency(options?.concurrency, () => new StreamImpl(channel.concatMap(toChannel(self), as => (0, _Function.pipe)(as, Chunk.map(a => toChannel(f(a))), Chunk.reduce(core.
|
|
869
|
+
return matchConcurrency(options?.concurrency, () => new StreamImpl(channel.concatMap(toChannel(self), as => (0, _Function.pipe)(as, Chunk.map(a => toChannel(f(a))), Chunk.reduce(core.void, (left, right) => (0, _Function.pipe)(left, channel.zipRight(right)))))), _ => new StreamImpl((0, _Function.pipe)(toChannel(self), channel.concatMap(channel.writeChunk), channel.mergeMap(out => toChannel(f(out)), options))));
|
|
870
870
|
});
|
|
871
871
|
/** @internal */
|
|
872
872
|
const matchConcurrency = (concurrency, sequential, bounded) => {
|
|
@@ -892,7 +892,7 @@ const flattenChunks = self => {
|
|
|
892
892
|
const flatten = core.readWithCause({
|
|
893
893
|
onInput: chunks => core.flatMap(channel.writeChunk(chunks), () => flatten),
|
|
894
894
|
onFailure: core.failCause,
|
|
895
|
-
onDone: () => core.
|
|
895
|
+
onDone: () => core.void
|
|
896
896
|
});
|
|
897
897
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), core.pipeTo(flatten)));
|
|
898
898
|
};
|
|
@@ -909,10 +909,10 @@ const flattenExitOption = self => {
|
|
|
909
909
|
onNone: () => cont,
|
|
910
910
|
onSome: Exit.match({
|
|
911
911
|
onFailure: cause => Option.match(Cause.flipCauseOption(cause), {
|
|
912
|
-
onNone: () => core.
|
|
912
|
+
onNone: () => core.void,
|
|
913
913
|
onSome: core.failCause
|
|
914
914
|
}),
|
|
915
|
-
onSuccess: () => core.
|
|
915
|
+
onSuccess: () => core.void
|
|
916
916
|
})
|
|
917
917
|
}));
|
|
918
918
|
return (0, _Function.pipe)(core.write((0, _Function.pipe)(toEmit, Chunk.filterMap(exit => Exit.isSuccess(exit) ? Option.some(exit.value) : Option.none()))), core.flatMap(() => next));
|
|
@@ -920,7 +920,7 @@ const flattenExitOption = self => {
|
|
|
920
920
|
const process = core.readWithCause({
|
|
921
921
|
onInput: chunk => processChunk(chunk, process),
|
|
922
922
|
onFailure: cause => core.failCause(cause),
|
|
923
|
-
onDone: () => core.
|
|
923
|
+
onDone: () => core.void
|
|
924
924
|
});
|
|
925
925
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), core.pipeTo(process)));
|
|
926
926
|
};
|
|
@@ -935,7 +935,7 @@ exports.flattenTake = flattenTake;
|
|
|
935
935
|
const forever = self => new StreamImpl(channel.repeated(toChannel(self)));
|
|
936
936
|
/** @internal */
|
|
937
937
|
exports.forever = forever;
|
|
938
|
-
const fromAsyncIterable = (iterable, onError) => (0, _Function.pipe)(Effect.acquireRelease(Effect.sync(() => iterable[Symbol.asyncIterator]()), iterator => iterator.return ? Effect.promise(async () => iterator.return()) : Effect.
|
|
938
|
+
const fromAsyncIterable = (iterable, onError) => (0, _Function.pipe)(Effect.acquireRelease(Effect.sync(() => iterable[Symbol.asyncIterator]()), iterator => iterator.return ? Effect.promise(async () => iterator.return()) : Effect.void), Effect.map(iterator => repeatEffectOption((0, _Function.pipe)(Effect.tryPromise({
|
|
939
939
|
try: async () => iterator.next(),
|
|
940
940
|
catch: reason => Option.some(onError(reason))
|
|
941
941
|
}), Effect.flatMap(result => result.done ? Effect.fail(Option.none()) : Effect.succeed(result.value))))), unwrapScoped);
|
|
@@ -955,7 +955,7 @@ const toChannel = stream => {
|
|
|
955
955
|
};
|
|
956
956
|
/** @internal */
|
|
957
957
|
exports.toChannel = toChannel;
|
|
958
|
-
const fromChunk = chunk => new StreamImpl(Chunk.isEmpty(chunk) ? core.
|
|
958
|
+
const fromChunk = chunk => new StreamImpl(Chunk.isEmpty(chunk) ? core.void : core.write(chunk));
|
|
959
959
|
/** @internal */
|
|
960
960
|
exports.fromChunk = fromChunk;
|
|
961
961
|
const fromChunkPubSub = (pubsub, options) => {
|
|
@@ -979,7 +979,7 @@ const fromEffect = effect => (0, _Function.pipe)(effect, Effect.mapError(Option.
|
|
|
979
979
|
exports.fromEffect = fromEffect;
|
|
980
980
|
const fromEffectOption = effect => new StreamImpl(channel.unwrap(Effect.match(effect, {
|
|
981
981
|
onFailure: Option.match({
|
|
982
|
-
onNone: () => core.
|
|
982
|
+
onNone: () => core.void,
|
|
983
983
|
onSome: core.fail
|
|
984
984
|
}),
|
|
985
985
|
onSuccess: a => core.write(Chunk.of(a))
|
|
@@ -1015,7 +1015,7 @@ const fromIteratorSucceed = (iterator, maxChunkSize = DefaultChunkSize) => {
|
|
|
1015
1015
|
let next = iterator.next();
|
|
1016
1016
|
if (maxChunkSize === 1) {
|
|
1017
1017
|
if (next.done) {
|
|
1018
|
-
return core.
|
|
1018
|
+
return core.void;
|
|
1019
1019
|
}
|
|
1020
1020
|
return (0, _Function.pipe)(core.write(Chunk.of(next.value)), core.flatMap(() => loop(iterator)));
|
|
1021
1021
|
}
|
|
@@ -1032,7 +1032,7 @@ const fromIteratorSucceed = (iterator, maxChunkSize = DefaultChunkSize) => {
|
|
|
1032
1032
|
if (count > 0) {
|
|
1033
1033
|
return (0, _Function.pipe)(core.write(Chunk.unsafeFromArray(builder)), core.flatMap(() => loop(iterator)));
|
|
1034
1034
|
}
|
|
1035
|
-
return core.
|
|
1035
|
+
return core.void;
|
|
1036
1036
|
}), channel.unwrap);
|
|
1037
1037
|
return new StreamImpl(loop(iterator));
|
|
1038
1038
|
}), unwrap);
|
|
@@ -1162,11 +1162,11 @@ const haltWhen = exports.haltWhen = /*#__PURE__*/(0, _Function.dual)(2, (self, e
|
|
|
1162
1162
|
onNone: () => core.readWith({
|
|
1163
1163
|
onInput: input => core.flatMap(core.write(input), () => writer(fiber)),
|
|
1164
1164
|
onFailure: core.fail,
|
|
1165
|
-
onDone: () => core.
|
|
1165
|
+
onDone: () => core.void
|
|
1166
1166
|
}),
|
|
1167
1167
|
onSome: Exit.match({
|
|
1168
1168
|
onFailure: core.failCause,
|
|
1169
|
-
onSuccess: () => core.
|
|
1169
|
+
onSuccess: () => core.void
|
|
1170
1170
|
})
|
|
1171
1171
|
})), channel.unwrap);
|
|
1172
1172
|
return new StreamImpl((0, _Function.pipe)(Effect.forkScoped(effect), Effect.map(fiber => (0, _Function.pipe)(toChannel(self), core.pipeTo(writer(fiber)))), channel.unwrapScoped));
|
|
@@ -1179,11 +1179,11 @@ const haltWhenDeferred = exports.haltWhenDeferred = /*#__PURE__*/(0, _Function.d
|
|
|
1179
1179
|
onNone: () => core.readWith({
|
|
1180
1180
|
onInput: input => (0, _Function.pipe)(core.write(input), core.flatMap(() => writer)),
|
|
1181
1181
|
onFailure: core.fail,
|
|
1182
|
-
onDone: () => core.
|
|
1182
|
+
onDone: () => core.void
|
|
1183
1183
|
}),
|
|
1184
1184
|
onSome: effect => channel.unwrap(Effect.match(effect, {
|
|
1185
1185
|
onFailure: core.fail,
|
|
1186
|
-
onSuccess: () => core.
|
|
1186
|
+
onSuccess: () => core.void
|
|
1187
1187
|
}))
|
|
1188
1188
|
})), channel.unwrap);
|
|
1189
1189
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), core.pipeTo(writer)));
|
|
@@ -1205,14 +1205,14 @@ const interleaveWith = exports.interleaveWith = /*#__PURE__*/(0, _Function.dual)
|
|
|
1205
1205
|
onInput: bool => {
|
|
1206
1206
|
if (bool && !leftDone) {
|
|
1207
1207
|
return (0, _Function.pipe)(core.fromEffect(Handoff.take(left)), core.flatMap(InternalTake.match({
|
|
1208
|
-
onEnd: () => rightDone ? core.
|
|
1208
|
+
onEnd: () => rightDone ? core.void : process(true, rightDone),
|
|
1209
1209
|
onFailure: core.failCause,
|
|
1210
1210
|
onSuccess: chunk => (0, _Function.pipe)(core.write(chunk), core.flatMap(() => process(leftDone, rightDone)))
|
|
1211
1211
|
})));
|
|
1212
1212
|
}
|
|
1213
1213
|
if (!bool && !rightDone) {
|
|
1214
1214
|
return (0, _Function.pipe)(core.fromEffect(Handoff.take(right)), core.flatMap(InternalTake.match({
|
|
1215
|
-
onEnd: () => leftDone ? core.
|
|
1215
|
+
onEnd: () => leftDone ? core.void : process(leftDone, true),
|
|
1216
1216
|
onFailure: core.failCause,
|
|
1217
1217
|
onSuccess: chunk => (0, _Function.pipe)(core.write(chunk), core.flatMap(() => process(leftDone, rightDone)))
|
|
1218
1218
|
})));
|
|
@@ -1220,7 +1220,7 @@ const interleaveWith = exports.interleaveWith = /*#__PURE__*/(0, _Function.dual)
|
|
|
1220
1220
|
return process(leftDone, rightDone);
|
|
1221
1221
|
},
|
|
1222
1222
|
onFailure: core.failCause,
|
|
1223
|
-
onDone: () => core.
|
|
1223
|
+
onDone: () => core.void
|
|
1224
1224
|
});
|
|
1225
1225
|
return (0, _Function.pipe)(toChannel(decider), channel.concatMap(channel.writeChunk), core.pipeTo(process(false, false)));
|
|
1226
1226
|
}))));
|
|
@@ -1243,7 +1243,7 @@ const intersperse = exports.intersperse = /*#__PURE__*/(0, _Function.dual)(2, (s
|
|
|
1243
1243
|
return (0, _Function.pipe)(core.write(Chunk.unsafeFromArray(builder)), core.flatMap(() => writer(flagResult)));
|
|
1244
1244
|
},
|
|
1245
1245
|
onFailure: core.failCause,
|
|
1246
|
-
onDone: () => core.
|
|
1246
|
+
onDone: () => core.void
|
|
1247
1247
|
});
|
|
1248
1248
|
return writer(true);
|
|
1249
1249
|
})))));
|
|
@@ -1275,7 +1275,7 @@ const mapAccum = exports.mapAccum = /*#__PURE__*/(0, _Function.dual)(3, (self, s
|
|
|
1275
1275
|
return core.flatMap(core.write(chunk), () => accumulator(nextS));
|
|
1276
1276
|
},
|
|
1277
1277
|
onFailure: core.fail,
|
|
1278
|
-
onDone: () => core.
|
|
1278
|
+
onDone: () => core.void
|
|
1279
1279
|
});
|
|
1280
1280
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), core.pipeTo(accumulator(s))));
|
|
1281
1281
|
});
|
|
@@ -1298,7 +1298,7 @@ const mapAccumEffect = exports.mapAccumEffect = /*#__PURE__*/(0, _Function.dual)
|
|
|
1298
1298
|
}));
|
|
1299
1299
|
}), channel.unwrap),
|
|
1300
1300
|
onFailure: core.fail,
|
|
1301
|
-
onDone: () => core.
|
|
1301
|
+
onDone: () => core.void
|
|
1302
1302
|
});
|
|
1303
1303
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), channel.pipeToOrFail(accumulator(s))));
|
|
1304
1304
|
}));
|
|
@@ -1376,7 +1376,7 @@ const never = exports.never = /*#__PURE__*/fromEffect(Effect.never);
|
|
|
1376
1376
|
/** @internal */
|
|
1377
1377
|
const onError = exports.onError = /*#__PURE__*/(0, _Function.dual)(2, (self, cleanup) => (0, _Function.pipe)(self, catchAllCause(cause => fromEffect((0, _Function.pipe)(cleanup(cause), Effect.zipRight(Effect.failCause(cause)))))));
|
|
1378
1378
|
/** @internal */
|
|
1379
|
-
const onDone = exports.onDone = /*#__PURE__*/(0, _Function.dual)(2, (self, cleanup) => new StreamImpl((0, _Function.pipe)(toChannel(self), core.ensuringWith(exit => Exit.isSuccess(exit) ? cleanup() : Effect.
|
|
1379
|
+
const onDone = exports.onDone = /*#__PURE__*/(0, _Function.dual)(2, (self, cleanup) => new StreamImpl((0, _Function.pipe)(toChannel(self), core.ensuringWith(exit => Exit.isSuccess(exit) ? cleanup() : Effect.void))));
|
|
1380
1380
|
/** @internal */
|
|
1381
1381
|
const orDie = self => (0, _Function.pipe)(self, orDieWith(_Function.identity));
|
|
1382
1382
|
/** @internal */
|
|
@@ -1419,7 +1419,7 @@ const paginateChunk = (s, f) => {
|
|
|
1419
1419
|
const loop = s => {
|
|
1420
1420
|
const page = f(s);
|
|
1421
1421
|
return Option.match(page[1], {
|
|
1422
|
-
onNone: () => channel.zipRight(core.write(page[0]), core.
|
|
1422
|
+
onNone: () => channel.zipRight(core.write(page[0]), core.void),
|
|
1423
1423
|
onSome: s => core.flatMap(core.write(page[0]), () => loop(s))
|
|
1424
1424
|
});
|
|
1425
1425
|
};
|
|
@@ -1429,7 +1429,7 @@ const paginateChunk = (s, f) => {
|
|
|
1429
1429
|
exports.paginateChunk = paginateChunk;
|
|
1430
1430
|
const paginateChunkEffect = (s, f) => {
|
|
1431
1431
|
const loop = s => channel.unwrap(Effect.map(f(s), ([chunk, option]) => Option.match(option, {
|
|
1432
|
-
onNone: () => channel.zipRight(core.write(chunk), core.
|
|
1432
|
+
onNone: () => channel.zipRight(core.write(chunk), core.void),
|
|
1433
1433
|
onSome: s => core.flatMap(core.write(chunk), () => loop(s))
|
|
1434
1434
|
})));
|
|
1435
1435
|
return new StreamImpl(core.suspend(() => loop(s)));
|
|
@@ -1458,7 +1458,7 @@ const peel = exports.peel = /*#__PURE__*/(0, _Function.dual)(2, (self, sink) =>
|
|
|
1458
1458
|
})), core.failCause(cause)),
|
|
1459
1459
|
onDone: _ => channel.zipRight(core.fromEffect(Handoff.offer(handoff, {
|
|
1460
1460
|
_tag: OP_END
|
|
1461
|
-
})), core.
|
|
1461
|
+
})), core.void)
|
|
1462
1462
|
});
|
|
1463
1463
|
return _sink.fromChannel((0, _Function.pipe)(core.fromEffect(Deferred.succeed(deferred, z)), channel.zipRight(core.fromEffect((0, _Function.pipe)(handoff, Handoff.offer({
|
|
1464
1464
|
_tag: OP_EMIT,
|
|
@@ -1478,7 +1478,7 @@ const peel = exports.peel = /*#__PURE__*/(0, _Function.dual)(2, (self, sink) =>
|
|
|
1478
1478
|
}
|
|
1479
1479
|
case OP_END:
|
|
1480
1480
|
{
|
|
1481
|
-
return core.
|
|
1481
|
+
return core.void;
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
1484
|
}), channel.unwrap);
|
|
@@ -1603,7 +1603,7 @@ class StreamRechunker {
|
|
|
1603
1603
|
if (this.pos !== 0) {
|
|
1604
1604
|
return core.write(Chunk.unsafeFromArray(this.builder));
|
|
1605
1605
|
}
|
|
1606
|
-
return core.
|
|
1606
|
+
return core.void;
|
|
1607
1607
|
}
|
|
1608
1608
|
}
|
|
1609
1609
|
/** @internal */
|
|
@@ -1658,7 +1658,7 @@ const repeatElementsWith = exports.repeatElementsWith = /*#__PURE__*/(0, _Functi
|
|
|
1658
1658
|
const loop = core.readWith({
|
|
1659
1659
|
onInput: feed,
|
|
1660
1660
|
onFailure: core.fail,
|
|
1661
|
-
onDone: () => core.
|
|
1661
|
+
onDone: () => core.void
|
|
1662
1662
|
});
|
|
1663
1663
|
return loop;
|
|
1664
1664
|
}), channel.unwrap);
|
|
@@ -1673,7 +1673,7 @@ const repeatWith = exports.repeatWith = /*#__PURE__*/(0, _Function.dual)(3, (sel
|
|
|
1673
1673
|
const scheduleOutput = (0, _Function.pipe)(driver.last, Effect.orDie, Effect.map(options.onSchedule));
|
|
1674
1674
|
const process = (0, _Function.pipe)(self, map(options.onElement), toChannel);
|
|
1675
1675
|
const loop = channel.unwrap(Effect.match(driver.next(void 0), {
|
|
1676
|
-
onFailure: () => core.
|
|
1676
|
+
onFailure: () => core.void,
|
|
1677
1677
|
onSuccess: () => (0, _Function.pipe)(process, channel.zipRight((0, _Function.pipe)(scheduleOutput, Effect.map(c => (0, _Function.pipe)(core.write(Chunk.of(c)), core.flatMap(() => loop))), channel.unwrap)))
|
|
1678
1678
|
}));
|
|
1679
1679
|
return new StreamImpl((0, _Function.pipe)(process, channel.zipRight(loop)));
|
|
@@ -1749,7 +1749,7 @@ const runIntoQueueElementsScoped = exports.runIntoQueueElementsScoped = /*#__PUR
|
|
|
1749
1749
|
onFailure: cause => core.fromEffect(Queue.offer(queue, Exit.failCause(Cause.map(cause, Option.some)))),
|
|
1750
1750
|
onDone: () => core.fromEffect(Queue.offer(queue, Exit.fail(Option.none())))
|
|
1751
1751
|
});
|
|
1752
|
-
return (0, _Function.pipe)(core.pipeTo(toChannel(self), writer), channel.drain, channelExecutor.runScoped, Effect.
|
|
1752
|
+
return (0, _Function.pipe)(core.pipeTo(toChannel(self), writer), channel.drain, channelExecutor.runScoped, Effect.asVoid);
|
|
1753
1753
|
});
|
|
1754
1754
|
/** @internal */
|
|
1755
1755
|
const runIntoQueueScoped = exports.runIntoQueueScoped = /*#__PURE__*/(0, _Function.dual)(2, (self, queue) => {
|
|
@@ -1758,7 +1758,7 @@ const runIntoQueueScoped = exports.runIntoQueueScoped = /*#__PURE__*/(0, _Functi
|
|
|
1758
1758
|
onFailure: cause => core.write(InternalTake.failCause(cause)),
|
|
1759
1759
|
onDone: () => core.write(InternalTake.end)
|
|
1760
1760
|
});
|
|
1761
|
-
return (0, _Function.pipe)(core.pipeTo(toChannel(self), writer), channel.mapOutEffect(take => Queue.offer(queue, take)), channel.drain, channelExecutor.runScoped, Effect.
|
|
1761
|
+
return (0, _Function.pipe)(core.pipeTo(toChannel(self), writer), channel.mapOutEffect(take => Queue.offer(queue, take)), channel.drain, channelExecutor.runScoped, Effect.asVoid);
|
|
1762
1762
|
});
|
|
1763
1763
|
/** @internal */
|
|
1764
1764
|
const runLast = self => (0, _Function.pipe)(self, run(_sink.last()));
|
|
@@ -1811,7 +1811,7 @@ const scheduleWith = exports.scheduleWith = /*#__PURE__*/(0, _Function.dual)(3,
|
|
|
1811
1811
|
/** @internal */
|
|
1812
1812
|
const scanEffect = exports.scanEffect = /*#__PURE__*/(0, _Function.dual)(3, (self, s, f) => new StreamImpl((0, _Function.pipe)(core.write(Chunk.of(s)), core.flatMap(() => toChannel((0, _Function.pipe)(self, mapAccumEffect(s, (s, a) => (0, _Function.pipe)(f(s, a), Effect.map(s => [s, s])))))))));
|
|
1813
1813
|
/** @internal */
|
|
1814
|
-
const scoped = effect => new StreamImpl(channel.ensuring(channel.scoped((0, _Function.pipe)(effect, Effect.map(Chunk.of))), Effect.
|
|
1814
|
+
const scoped = effect => new StreamImpl(channel.ensuring(channel.scoped((0, _Function.pipe)(effect, Effect.map(Chunk.of))), Effect.void));
|
|
1815
1815
|
/** @internal */
|
|
1816
1816
|
exports.scoped = scoped;
|
|
1817
1817
|
const some = self => (0, _Function.pipe)(self, mapError(Option.some), someOrFail(() => Option.none()));
|
|
@@ -1857,7 +1857,7 @@ const slidingSize = exports.slidingSize = /*#__PURE__*/(0, _Function.dual)(3, (s
|
|
|
1857
1857
|
return Option.some(queue.toChunk());
|
|
1858
1858
|
})), () => reader(queueSize + input.length)),
|
|
1859
1859
|
onFailure: cause => emitOnStreamEnd(queueSize, core.failCause(cause)),
|
|
1860
|
-
onDone: () => emitOnStreamEnd(queueSize, core.
|
|
1860
|
+
onDone: () => emitOnStreamEnd(queueSize, core.void)
|
|
1861
1861
|
});
|
|
1862
1862
|
return (0, _Function.pipe)(toChannel(self), core.pipeTo(reader(0)));
|
|
1863
1863
|
}));
|
|
@@ -1876,12 +1876,12 @@ const split = exports.split = /*#__PURE__*/(0, _Function.dual)(2, (self, predica
|
|
|
1876
1876
|
onFailure: core.fail,
|
|
1877
1877
|
onDone: () => {
|
|
1878
1878
|
if (Chunk.isEmpty(leftovers)) {
|
|
1879
|
-
return core.
|
|
1879
|
+
return core.void;
|
|
1880
1880
|
}
|
|
1881
1881
|
if (Option.isNone((0, _Function.pipe)(leftovers, Chunk.findFirst(predicate)))) {
|
|
1882
|
-
return channel.zipRight(core.write(Chunk.of(leftovers)), core.
|
|
1882
|
+
return channel.zipRight(core.write(Chunk.of(leftovers)), core.void);
|
|
1883
1883
|
}
|
|
1884
|
-
return channel.zipRight(split(Chunk.empty(), leftovers), core.
|
|
1884
|
+
return channel.zipRight(split(Chunk.empty(), leftovers), core.void);
|
|
1885
1885
|
}
|
|
1886
1886
|
});
|
|
1887
1887
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), core.pipeTo(loop(Chunk.empty()))));
|
|
@@ -1949,7 +1949,7 @@ const take = exports.take = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
|
|
|
1949
1949
|
onFailure: core.fail,
|
|
1950
1950
|
onDone: core.succeed
|
|
1951
1951
|
});
|
|
1952
|
-
return new StreamImpl((0, _Function.pipe)(toChannel(self), channel.pipeToOrFail(0 < n ? loop(n) : core.
|
|
1952
|
+
return new StreamImpl((0, _Function.pipe)(toChannel(self), channel.pipeToOrFail(0 < n ? loop(n) : core.void)));
|
|
1953
1953
|
});
|
|
1954
1954
|
/** @internal */
|
|
1955
1955
|
const takeRight = exports.takeRight = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
|
|
@@ -1965,7 +1965,7 @@ const takeRight = exports.takeRight = /*#__PURE__*/(0, _Function.dual)(2, (self,
|
|
|
1965
1965
|
return reader;
|
|
1966
1966
|
},
|
|
1967
1967
|
onFailure: core.fail,
|
|
1968
|
-
onDone: () => (0, _Function.pipe)(core.write(queue.toChunk()), channel.zipRight(core.
|
|
1968
|
+
onDone: () => (0, _Function.pipe)(core.write(queue.toChunk()), channel.zipRight(core.void))
|
|
1969
1969
|
});
|
|
1970
1970
|
return (0, _Function.pipe)(toChannel(self), core.pipeTo(reader));
|
|
1971
1971
|
}), channel.unwrap));
|
|
@@ -2047,8 +2047,8 @@ const tapSink = exports.tapSink = /*#__PURE__*/(0, _Function.dual)(2, (self, sin
|
|
|
2047
2047
|
onSuccess: () => core.failCause(cause)
|
|
2048
2048
|
})),
|
|
2049
2049
|
onDone: () => (0, _Function.pipe)(core.fromEffect(Queue.offer(queue, InternalTake.end)), core.foldCauseChannel({
|
|
2050
|
-
onFailure: () => core.
|
|
2051
|
-
onSuccess: () => core.
|
|
2050
|
+
onFailure: () => core.void,
|
|
2051
|
+
onSuccess: () => core.void
|
|
2052
2052
|
}))
|
|
2053
2053
|
});
|
|
2054
2054
|
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)))))));
|
|
@@ -2079,7 +2079,7 @@ const throttleEnforceEffect = (self, cost, units, duration, burst) => {
|
|
|
2079
2079
|
return loop(tokens, timestampMillis);
|
|
2080
2080
|
}), channel.unwrap),
|
|
2081
2081
|
onFailure: core.failCause,
|
|
2082
|
-
onDone: () => core.
|
|
2082
|
+
onDone: () => core.void
|
|
2083
2083
|
});
|
|
2084
2084
|
const throttled = (0, _Function.pipe)(Clock.currentTimeMillis, Effect.map(currentTimeMillis => loop(units, currentTimeMillis)), channel.unwrap);
|
|
2085
2085
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), channel.pipeToOrFail(throttled)));
|
|
@@ -2101,7 +2101,7 @@ const throttleShapeEffect = (self, costFn, units, duration, burst) => {
|
|
|
2101
2101
|
return core.flatMap(core.write(input), () => loop(remaining, currentTimeMillis));
|
|
2102
2102
|
}), channel.unwrap),
|
|
2103
2103
|
onFailure: core.failCause,
|
|
2104
|
-
onDone: () => core.
|
|
2104
|
+
onDone: () => core.void
|
|
2105
2105
|
});
|
|
2106
2106
|
const throttled = (0, _Function.pipe)(Clock.currentTimeMillis, Effect.map(currentTimeMillis => loop(units, currentTimeMillis)), channel.unwrap);
|
|
2107
2107
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), channel.pipeToOrFail(throttled)));
|
|
@@ -2149,20 +2149,20 @@ const toReadableStream = source => {
|
|
|
2149
2149
|
Chunk.map(chunk, a => {
|
|
2150
2150
|
controller.enqueue(a);
|
|
2151
2151
|
});
|
|
2152
|
-
})), Effect.tapErrorCause(() => Scope.close(scope, Exit.
|
|
2152
|
+
})), Effect.tapErrorCause(() => Scope.close(scope, Exit.void)), Effect.catchTags({
|
|
2153
2153
|
"None": () => Effect.sync(() => {
|
|
2154
2154
|
controller.close();
|
|
2155
2155
|
}),
|
|
2156
2156
|
"Some": error => Effect.sync(() => {
|
|
2157
2157
|
controller.error(error.value);
|
|
2158
2158
|
})
|
|
2159
|
-
}), Effect.
|
|
2159
|
+
}), Effect.asVoid);
|
|
2160
2160
|
},
|
|
2161
2161
|
pull() {
|
|
2162
2162
|
return Effect.runPromise(pull);
|
|
2163
2163
|
},
|
|
2164
2164
|
cancel() {
|
|
2165
|
-
return Effect.runPromise(Scope.close(scope, Exit.
|
|
2165
|
+
return Effect.runPromise(Scope.close(scope, Exit.void));
|
|
2166
2166
|
}
|
|
2167
2167
|
});
|
|
2168
2168
|
};
|
|
@@ -2202,7 +2202,7 @@ const transduce = exports.transduce = /*#__PURE__*/(0, _Function.dual)(2, (self,
|
|
|
2202
2202
|
}), core.succeedNow(done))
|
|
2203
2203
|
});
|
|
2204
2204
|
const transducer = (0, _Function.pipe)(sink, _sink.toChannel, core.collectElements, core.flatMap(([leftover, z]) => (0, _Function.pipe)(core.succeed([upstreamDone.ref, concatAndGet(leftover)]), core.flatMap(([done, newLeftovers]) => {
|
|
2205
|
-
const nextChannel = done && Chunk.isEmpty(newLeftovers) ? core.
|
|
2205
|
+
const nextChannel = done && Chunk.isEmpty(newLeftovers) ? core.void : transducer;
|
|
2206
2206
|
return (0, _Function.pipe)(core.write(Chunk.of(z)), core.flatMap(() => nextChannel));
|
|
2207
2207
|
}))));
|
|
2208
2208
|
return (0, _Function.pipe)(toChannel(self), core.pipeTo(upstreamMarker), core.pipeTo(buffer), channel.pipeToOrFail(transducer));
|
|
@@ -2215,7 +2215,7 @@ const unfold = (s, f) => unfoldChunk(s, s => (0, _Function.pipe)(f(s), Option.ma
|
|
|
2215
2215
|
exports.unfold = unfold;
|
|
2216
2216
|
const unfoldChunk = (s, f) => {
|
|
2217
2217
|
const loop = s => Option.match(f(s), {
|
|
2218
|
-
onNone: () => core.
|
|
2218
|
+
onNone: () => core.void,
|
|
2219
2219
|
onSome: ([chunk, s]) => core.flatMap(core.write(chunk), () => loop(s))
|
|
2220
2220
|
});
|
|
2221
2221
|
return new StreamImpl(core.suspend(() => loop(s)));
|
|
@@ -2224,7 +2224,7 @@ const unfoldChunk = (s, f) => {
|
|
|
2224
2224
|
exports.unfoldChunk = unfoldChunk;
|
|
2225
2225
|
const unfoldChunkEffect = (s, f) => suspend(() => {
|
|
2226
2226
|
const loop = s => channel.unwrap(Effect.map(f(s), Option.match({
|
|
2227
|
-
onNone: () => core.
|
|
2227
|
+
onNone: () => core.void,
|
|
2228
2228
|
onSome: ([chunk, s]) => core.flatMap(core.write(chunk), () => loop(s))
|
|
2229
2229
|
})));
|
|
2230
2230
|
return new StreamImpl(loop(s));
|
|
@@ -2232,9 +2232,8 @@ const unfoldChunkEffect = (s, f) => suspend(() => {
|
|
|
2232
2232
|
/** @internal */
|
|
2233
2233
|
exports.unfoldChunkEffect = unfoldChunkEffect;
|
|
2234
2234
|
const unfoldEffect = (s, f) => unfoldChunkEffect(s, s => (0, _Function.pipe)(f(s), Effect.map(Option.map(([a, s]) => [Chunk.of(a), s]))));
|
|
2235
|
-
/** @internal */
|
|
2236
2235
|
exports.unfoldEffect = unfoldEffect;
|
|
2237
|
-
const
|
|
2236
|
+
const void_ = exports.void = /*#__PURE__*/succeed(void 0);
|
|
2238
2237
|
/** @internal */
|
|
2239
2238
|
const unwrap = effect => flatten(fromEffect(effect));
|
|
2240
2239
|
/** @internal */
|
|
@@ -2684,8 +2683,8 @@ const zipWithNext = self => {
|
|
|
2684
2683
|
},
|
|
2685
2684
|
onFailure: core.failCause,
|
|
2686
2685
|
onDone: () => Option.match(last, {
|
|
2687
|
-
onNone: () => core.
|
|
2688
|
-
onSome: value => channel.zipRight(core.write(Chunk.of([value, Option.none()])), core.
|
|
2686
|
+
onNone: () => core.void,
|
|
2687
|
+
onSome: value => channel.zipRight(core.write(Chunk.of([value, Option.none()])), core.void)
|
|
2689
2688
|
})
|
|
2690
2689
|
});
|
|
2691
2690
|
return new StreamImpl((0, _Function.pipe)(toChannel(self), channel.pipeToOrFail(process(Option.none()))));
|