@fncts/io 0.0.48 → 0.0.50
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/Cached/api.d.ts +1 -1
- package/Channel/api.d.ts +80 -80
- package/Channel/core-api.d.ts +26 -26
- package/Console/definition.d.ts +1 -0
- package/CountdownLatch.d.ts +1 -0
- package/Fiber/FiberMessage.d.ts +6 -28
- package/Fiber/FiberRuntime.d.ts +108 -77
- package/Fiber/api/interruptAs.d.ts +2 -2
- package/Fiber/definition.d.ts +2 -0
- package/FiberScope/definition.d.ts +3 -0
- package/FiberSet.d.ts +2 -1
- package/Future/State.d.ts +59 -0
- package/Future/api.d.ts +8 -3
- package/Future/constructors.d.ts +1 -1
- package/Future/definition.d.ts +1 -17
- package/Future.d.ts +1 -0
- package/Hub/api.d.ts +15 -15
- package/IO/api/array.d.ts +22 -0
- package/IO/api/awaitAllChildren.d.ts +6 -0
- package/IO/api/cachedInvalidate.d.ts +15 -0
- package/IO/api/foreachExec.d.ts +18 -0
- package/IO/api/forkDaemon.d.ts +1 -1
- package/IO/api/onTermination.d.ts +1 -2
- package/IO/api/transplant.d.ts +11 -1
- package/IO/api.d.ts +247 -225
- package/IO/definition.d.ts +12 -25
- package/IO.d.ts +3 -1
- package/Push/Bounds.d.ts +4 -0
- package/Push/FlattenStrategy.d.ts +47 -0
- package/Push/IndexedBuffer.d.ts +19 -0
- package/Push/MergeStrategy.d.ts +19 -0
- package/Push/Operator/IOLoopOperator.d.ts +61 -0
- package/Push/Operator/IOOperator.d.ts +63 -0
- package/Push/Operator/LoopOperator.d.ts +50 -0
- package/Push/Operator/SyncOperator.d.ts +41 -0
- package/Push/Operator.d.ts +4 -0
- package/Push/Producer/IOProducer.d.ts +41 -0
- package/Push/Producer/SyncProducer.d.ts +61 -0
- package/Push/Producer.d.ts +1 -0
- package/Push/Sink.d.ts +65 -0
- package/Push/api.d.ts +78 -161
- package/Push/definition.d.ts +92 -19
- package/Push/internal.d.ts +3 -0
- package/Push.d.ts +6 -0
- package/Random/definition.d.ts +1 -0
- package/Ref/Synchronized/api.d.ts +1 -1
- package/Ref/Synchronized/definition.d.ts +32 -9
- package/Ref/definition.d.ts +12 -0
- package/Scope/api.d.ts +16 -1
- package/Semaphore/Reservation.d.ts +15 -0
- package/Semaphore/constructors.d.ts +13 -0
- package/Semaphore/definition.d.ts +29 -0
- package/Semaphore.d.ts +3 -40
- package/Sink/definition.d.ts +5 -6
- package/Stream/api.d.ts +164 -164
- package/Subject/Atomic.d.ts +19 -9
- package/Subject/DeferredRef.d.ts +17 -0
- package/Subject/Hold.d.ts +19 -0
- package/Subject/RefSubject/Atomic.d.ts +41 -0
- package/Subject/RefSubject/Derived.d.ts +43 -0
- package/Subject/RefSubject/RefSubject.d.ts +27 -0
- package/Subject/definition.d.ts +14 -2
- package/Subject.d.ts +2 -0
- package/SubscriptionRef.d.ts +0 -1
- package/_cjs/Cached/api.cjs +1 -2
- package/_cjs/Cached/api.cjs.map +1 -1
- package/_cjs/Cached/internal.cjs +1 -2
- package/_cjs/Cached/internal.cjs.map +1 -1
- package/_cjs/Channel/api/interruptWhen.cjs +1 -2
- package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
- package/_cjs/Channel/api/mapOutConcurrentIO.cjs +2 -3
- package/_cjs/Channel/api/mapOutConcurrentIO.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAll.cjs +1 -2
- package/_cjs/Channel/api/mergeAll.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAllUnboundedWith.cjs +1 -2
- package/_cjs/Channel/api/mergeAllUnboundedWith.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAllWith.cjs +2 -3
- package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
- package/_cjs/Channel/api/mergeMap.cjs +1 -2
- package/_cjs/Channel/api/mergeMap.cjs.map +1 -1
- package/_cjs/Channel/api/mergeWith.cjs +1 -2
- package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
- package/_cjs/Channel/api/run.cjs +1 -2
- package/_cjs/Channel/api/run.cjs.map +1 -1
- package/_cjs/Channel/api/runCollect.cjs +1 -2
- package/_cjs/Channel/api/runCollect.cjs.map +1 -1
- package/_cjs/Channel/api/runDrain.cjs +1 -2
- package/_cjs/Channel/api/runDrain.cjs.map +1 -1
- package/_cjs/Channel/api/runScoped.cjs +3 -4
- package/_cjs/Channel/api/runScoped.cjs.map +1 -1
- package/_cjs/Channel/api/toPull.cjs +2 -3
- package/_cjs/Channel/api/toPull.cjs.map +1 -1
- package/_cjs/Channel/api/zipConcurrent.cjs +1 -2
- package/_cjs/Channel/api/zipConcurrent.cjs.map +1 -1
- package/_cjs/Channel/api.cjs +206 -207
- package/_cjs/Channel/api.cjs.map +1 -1
- package/_cjs/Channel/core-api.cjs +43 -42
- package/_cjs/Channel/core-api.cjs.map +1 -1
- package/_cjs/Channel/internal/ChannelExecutor.cjs +4 -5
- package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
- package/_cjs/Channel/internal/ChannelState.cjs +1 -2
- package/_cjs/Channel/internal/ChannelState.cjs.map +1 -1
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +1 -2
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
- package/_cjs/Clock/api.cjs +1 -2
- package/_cjs/Clock/api.cjs.map +1 -1
- package/_cjs/Clock/definition.cjs +1 -2
- package/_cjs/Clock/definition.cjs.map +1 -1
- package/_cjs/Clock/live.cjs +1 -2
- package/_cjs/Clock/live.cjs.map +1 -1
- package/_cjs/Console/api.cjs +1 -2
- package/_cjs/Console/api.cjs.map +1 -1
- package/_cjs/Console/definition.cjs +2 -2
- package/_cjs/Console/definition.cjs.map +1 -1
- package/_cjs/Console/live.cjs +1 -2
- package/_cjs/Console/live.cjs.map +1 -1
- package/_cjs/CountdownLatch.cjs +3 -3
- package/_cjs/CountdownLatch.cjs.map +1 -1
- package/_cjs/Differ/api.cjs +1 -2
- package/_cjs/Differ/api.cjs.map +1 -1
- package/_cjs/Fiber/FiberMessage.cjs +3 -24
- package/_cjs/Fiber/FiberMessage.cjs.map +1 -1
- package/_cjs/Fiber/FiberRuntime.cjs +879 -636
- package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
- package/_cjs/Fiber/api/awaitAll.cjs +1 -2
- package/_cjs/Fiber/api/awaitAll.cjs.map +1 -1
- package/_cjs/Fiber/api/collectAll.cjs +2 -3
- package/_cjs/Fiber/api/collectAll.cjs.map +1 -1
- package/_cjs/Fiber/api/fromIO.cjs +1 -2
- package/_cjs/Fiber/api/fromIO.cjs.map +1 -1
- package/_cjs/Fiber/api/interrupt.cjs +2 -3
- package/_cjs/Fiber/api/interrupt.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAll.cjs +2 -3
- package/_cjs/Fiber/api/interruptAll.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAs.cjs +5 -10
- package/_cjs/Fiber/api/interruptAs.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptFork.cjs +2 -3
- package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
- package/_cjs/Fiber/api/join.cjs +1 -2
- package/_cjs/Fiber/api/join.cjs.map +1 -1
- package/_cjs/Fiber/api/joinAll.cjs +1 -2
- package/_cjs/Fiber/api/joinAll.cjs.map +1 -1
- package/_cjs/Fiber/api/mapFiber.cjs +1 -2
- package/_cjs/Fiber/api/mapFiber.cjs.map +1 -1
- package/_cjs/Fiber/api/mapIO.cjs +2 -3
- package/_cjs/Fiber/api/mapIO.cjs.map +1 -1
- package/_cjs/Fiber/api/zipWith.cjs +2 -3
- package/_cjs/Fiber/api/zipWith.cjs.map +1 -1
- package/_cjs/Fiber/constructors.cjs +2 -3
- package/_cjs/Fiber/constructors.cjs.map +1 -1
- package/_cjs/Fiber/definition.cjs +6 -4
- package/_cjs/Fiber/definition.cjs.map +1 -1
- package/_cjs/FiberRef/api/locallyScoped.cjs +1 -2
- package/_cjs/FiberRef/api/locallyScoped.cjs.map +1 -1
- package/_cjs/FiberRef/api/locallyScopedWith.cjs +1 -2
- package/_cjs/FiberRef/api/locallyScopedWith.cjs.map +1 -1
- package/_cjs/FiberRef/constructors.cjs +1 -2
- package/_cjs/FiberRef/constructors.cjs.map +1 -1
- package/_cjs/FiberRef/definition.cjs +1 -2
- package/_cjs/FiberRef/definition.cjs.map +1 -1
- package/_cjs/FiberRef/operations.cjs +1 -2
- package/_cjs/FiberRef/operations.cjs.map +1 -1
- package/_cjs/FiberRef/unsafe.cjs +1 -2
- package/_cjs/FiberRef/unsafe.cjs.map +1 -1
- package/_cjs/FiberRefs/Patch.cjs +1 -2
- package/_cjs/FiberRefs/Patch.cjs.map +1 -1
- package/_cjs/FiberRefs/api.cjs +1 -2
- package/_cjs/FiberRefs/api.cjs.map +1 -1
- package/_cjs/FiberRefs/definition.cjs +1 -2
- package/_cjs/FiberRefs/definition.cjs.map +1 -1
- package/_cjs/FiberScope/definition.cjs +29 -6
- package/_cjs/FiberScope/definition.cjs.map +1 -1
- package/_cjs/FiberSet.cjs +16 -15
- package/_cjs/FiberSet.cjs.map +1 -1
- package/_cjs/FiberStatus/definition.cjs +1 -2
- package/_cjs/FiberStatus/definition.cjs.map +1 -1
- package/_cjs/Future/State.cjs +108 -0
- package/_cjs/Future/State.cjs.map +1 -0
- package/_cjs/Future/api.cjs +71 -64
- package/_cjs/Future/api.cjs.map +1 -1
- package/_cjs/Future/constructors.cjs +3 -4
- package/_cjs/Future/constructors.cjs.map +1 -1
- package/_cjs/Future/definition.cjs +1 -15
- package/_cjs/Future/definition.cjs.map +1 -1
- package/_cjs/Future.cjs +11 -0
- package/_cjs/Future.cjs.map +1 -1
- package/_cjs/Hub/api.cjs +56 -57
- package/_cjs/Hub/api.cjs.map +1 -1
- package/_cjs/Hub/internal.cjs +1 -2
- package/_cjs/Hub/internal.cjs.map +1 -1
- package/_cjs/IO/api/acquireRelease.cjs +1 -2
- package/_cjs/IO/api/acquireRelease.cjs.map +1 -1
- package/_cjs/IO/api/acquireReleaseExit.cjs +1 -2
- package/_cjs/IO/api/acquireReleaseExit.cjs.map +1 -1
- package/_cjs/IO/api/acquireReleaseInterruptible.cjs +1 -2
- package/_cjs/IO/api/acquireReleaseInterruptible.cjs.map +1 -1
- package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs +1 -2
- package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs.map +1 -1
- package/_cjs/IO/api/addFinalizer.cjs +1 -2
- package/_cjs/IO/api/addFinalizer.cjs.map +1 -1
- package/_cjs/IO/api/addFinalizerExit.cjs +1 -2
- package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -1
- package/_cjs/IO/api/all.cjs +1 -2
- package/_cjs/IO/api/all.cjs.map +1 -1
- package/_cjs/IO/api/array.cjs +51 -0
- package/_cjs/IO/api/array.cjs.map +1 -0
- package/_cjs/IO/api/asyncIO.cjs +1 -2
- package/_cjs/IO/api/asyncIO.cjs.map +1 -1
- package/_cjs/IO/api/asyncInterrupt.cjs +1 -2
- package/_cjs/IO/api/asyncInterrupt.cjs.map +1 -1
- package/_cjs/IO/api/awaitAllChildren.cjs +17 -0
- package/_cjs/IO/api/awaitAllChildren.cjs.map +1 -0
- package/_cjs/IO/api/blocking.cjs +1 -2
- package/_cjs/IO/api/blocking.cjs.map +1 -1
- package/_cjs/IO/api/bracket.cjs +1 -2
- package/_cjs/IO/api/bracket.cjs.map +1 -1
- package/_cjs/IO/api/bracketExit.cjs +1 -2
- package/_cjs/IO/api/bracketExit.cjs.map +1 -1
- package/_cjs/IO/api/cachedInvalidate.cjs +47 -0
- package/_cjs/IO/api/cachedInvalidate.cjs.map +1 -0
- package/_cjs/IO/api/clockWith.cjs +1 -2
- package/_cjs/IO/api/clockWith.cjs.map +1 -1
- package/_cjs/IO/api/concurrency.cjs +1 -2
- package/_cjs/IO/api/concurrency.cjs.map +1 -1
- package/_cjs/IO/api/concurrentFinalizers.cjs +1 -2
- package/_cjs/IO/api/concurrentFinalizers.cjs.map +1 -1
- package/_cjs/IO/api/consoleWith.cjs +1 -2
- package/_cjs/IO/api/consoleWith.cjs.map +1 -1
- package/_cjs/IO/api/daemonChildren.cjs +1 -2
- package/_cjs/IO/api/daemonChildren.cjs.map +1 -1
- package/_cjs/IO/api/delay.cjs +1 -2
- package/_cjs/IO/api/delay.cjs.map +1 -1
- package/_cjs/IO/api/descriptor.cjs +1 -2
- package/_cjs/IO/api/descriptor.cjs.map +1 -1
- package/_cjs/IO/api/diffFiberRefs.cjs +1 -2
- package/_cjs/IO/api/diffFiberRefs.cjs.map +1 -1
- package/_cjs/IO/api/disconnect.cjs +2 -3
- package/_cjs/IO/api/disconnect.cjs.map +1 -1
- package/_cjs/IO/api/ensuringChildren.cjs +1 -2
- package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
- package/_cjs/IO/api/environment.cjs +1 -2
- package/_cjs/IO/api/environment.cjs.map +1 -1
- package/_cjs/IO/api/foreachConcurrent.cjs +36 -30
- package/_cjs/IO/api/foreachConcurrent.cjs.map +1 -1
- package/_cjs/IO/api/foreachExec.cjs +30 -6
- package/_cjs/IO/api/foreachExec.cjs.map +1 -1
- package/_cjs/IO/api/fork.cjs +2 -3
- package/_cjs/IO/api/fork.cjs.map +1 -1
- package/_cjs/IO/api/forkAll.cjs +1 -2
- package/_cjs/IO/api/forkAll.cjs.map +1 -1
- package/_cjs/IO/api/forkDaemon.cjs +5 -6
- package/_cjs/IO/api/forkDaemon.cjs.map +1 -1
- package/_cjs/IO/api/forkIn.cjs +1 -2
- package/_cjs/IO/api/forkIn.cjs.map +1 -1
- package/_cjs/IO/api/forkScoped.cjs +1 -2
- package/_cjs/IO/api/forkScoped.cjs.map +1 -1
- package/_cjs/IO/api/fulfill.cjs +1 -2
- package/_cjs/IO/api/fulfill.cjs.map +1 -1
- package/_cjs/IO/api/interrupt.cjs +4 -5
- package/_cjs/IO/api/interrupt.cjs.map +1 -1
- package/_cjs/IO/api/memoize.cjs +1 -2
- package/_cjs/IO/api/memoize.cjs.map +1 -1
- package/_cjs/IO/api/onTermination.cjs +2 -3
- package/_cjs/IO/api/onTermination.cjs.map +1 -1
- package/_cjs/IO/api/once.cjs +1 -2
- package/_cjs/IO/api/once.cjs.map +1 -1
- package/_cjs/IO/api/patchFiberRefs.cjs +1 -2
- package/_cjs/IO/api/patchFiberRefs.cjs.map +1 -1
- package/_cjs/IO/api/provideLayer.cjs +1 -2
- package/_cjs/IO/api/provideLayer.cjs.map +1 -1
- package/_cjs/IO/api/provideScope.cjs +1 -2
- package/_cjs/IO/api/provideScope.cjs.map +1 -1
- package/_cjs/IO/api/provideSomeLayer.cjs +1 -2
- package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -1
- package/_cjs/IO/api/provideSomeRuntime.cjs +1 -2
- package/_cjs/IO/api/provideSomeRuntime.cjs.map +1 -1
- package/_cjs/IO/api/race.cjs +2 -3
- package/_cjs/IO/api/race.cjs.map +1 -1
- package/_cjs/IO/api/raceFirst.cjs +1 -2
- package/_cjs/IO/api/raceFirst.cjs.map +1 -1
- package/_cjs/IO/api/raceWith.cjs +1 -2
- package/_cjs/IO/api/raceWith.cjs.map +1 -1
- package/_cjs/IO/api/randomWith.cjs +1 -2
- package/_cjs/IO/api/randomWith.cjs.map +1 -1
- package/_cjs/IO/api/repeat.cjs +1 -2
- package/_cjs/IO/api/repeat.cjs.map +1 -1
- package/_cjs/IO/api/retry.cjs +1 -2
- package/_cjs/IO/api/retry.cjs.map +1 -1
- package/_cjs/IO/api/schedule.cjs +1 -2
- package/_cjs/IO/api/schedule.cjs.map +1 -1
- package/_cjs/IO/api/scope.cjs +1 -2
- package/_cjs/IO/api/scope.cjs.map +1 -1
- package/_cjs/IO/api/scopeWith.cjs +1 -2
- package/_cjs/IO/api/scopeWith.cjs.map +1 -1
- package/_cjs/IO/api/scoped.cjs +1 -2
- package/_cjs/IO/api/scoped.cjs.map +1 -1
- package/_cjs/IO/api/sleep.cjs +1 -2
- package/_cjs/IO/api/sleep.cjs.map +1 -1
- package/_cjs/IO/api/stateful.cjs +1 -2
- package/_cjs/IO/api/stateful.cjs.map +1 -1
- package/_cjs/IO/api/supervised.cjs +1 -2
- package/_cjs/IO/api/supervised.cjs.map +1 -1
- package/_cjs/IO/api/timeout.cjs +9 -11
- package/_cjs/IO/api/timeout.cjs.map +1 -1
- package/_cjs/IO/api/transplant.cjs +22 -7
- package/_cjs/IO/api/transplant.cjs.map +1 -1
- package/_cjs/IO/api/whenFiberRef.cjs +1 -2
- package/_cjs/IO/api/whenFiberRef.cjs.map +1 -1
- package/_cjs/IO/api/whenRef.cjs +1 -2
- package/_cjs/IO/api/whenRef.cjs.map +1 -1
- package/_cjs/IO/api/withChildren.cjs +1 -2
- package/_cjs/IO/api/withChildren.cjs.map +1 -1
- package/_cjs/IO/api/withEarlyRelease.cjs +1 -2
- package/_cjs/IO/api/withEarlyRelease.cjs.map +1 -1
- package/_cjs/IO/api/withFinalizer.cjs +1 -2
- package/_cjs/IO/api/withFinalizer.cjs.map +1 -1
- package/_cjs/IO/api/withFinalizerExit.cjs +1 -2
- package/_cjs/IO/api/withFinalizerExit.cjs.map +1 -1
- package/_cjs/IO/api/zipConcurrent.cjs +5 -6
- package/_cjs/IO/api/zipConcurrent.cjs.map +1 -1
- package/_cjs/IO/api.cjs +522 -473
- package/_cjs/IO/api.cjs.map +1 -1
- package/_cjs/IO/definition.cjs +2 -3
- package/_cjs/IO/definition.cjs.map +1 -1
- package/_cjs/IO/runtime.cjs +9 -10
- package/_cjs/IO/runtime.cjs.map +1 -1
- package/_cjs/IO.cjs +33 -11
- package/_cjs/IO.cjs.map +1 -1
- package/_cjs/IOEnv/definition.cjs +1 -2
- package/_cjs/IOEnv/definition.cjs.map +1 -1
- package/_cjs/IOEnv/live.cjs +1 -2
- package/_cjs/IOEnv/live.cjs.map +1 -1
- package/_cjs/IOEnv/services.cjs +1 -2
- package/_cjs/IOEnv/services.cjs.map +1 -1
- package/_cjs/Layer/MemoMap.cjs +1 -2
- package/_cjs/Layer/MemoMap.cjs.map +1 -1
- package/_cjs/Layer/api.cjs +1 -2
- package/_cjs/Layer/api.cjs.map +1 -1
- package/_cjs/Logger/api.cjs +1 -2
- package/_cjs/Logger/api.cjs.map +1 -1
- package/_cjs/Logger/constructors.cjs +1 -2
- package/_cjs/Logger/constructors.cjs.map +1 -1
- package/_cjs/MVar/api.cjs +1 -2
- package/_cjs/MVar/api.cjs.map +1 -1
- package/_cjs/Push/Bounds.cjs +2 -0
- package/_cjs/Push/Bounds.cjs.map +1 -0
- package/_cjs/Push/FlattenStrategy.cjs +95 -0
- package/_cjs/Push/FlattenStrategy.cjs.map +1 -0
- package/_cjs/Push/IndexedBuffer.cjs +70 -0
- package/_cjs/Push/IndexedBuffer.cjs.map +1 -0
- package/_cjs/Push/MergeStrategy.cjs +45 -0
- package/_cjs/Push/MergeStrategy.cjs.map +1 -0
- package/_cjs/Push/Operator/IOLoopOperator.cjs +225 -0
- package/_cjs/Push/Operator/IOLoopOperator.cjs.map +1 -0
- package/_cjs/Push/Operator/IOOperator.cjs +104 -0
- package/_cjs/Push/Operator/IOOperator.cjs.map +1 -0
- package/_cjs/Push/Operator/LoopOperator.cjs +165 -0
- package/_cjs/Push/Operator/LoopOperator.cjs.map +1 -0
- package/_cjs/Push/Operator/SyncOperator.cjs +78 -0
- package/_cjs/Push/Operator/SyncOperator.cjs.map +1 -0
- package/_cjs/Push/Operator.cjs +2 -0
- package/_cjs/Push/Operator.cjs.map +1 -0
- package/_cjs/Push/Producer/IOProducer.cjs +67 -0
- package/_cjs/Push/Producer/IOProducer.cjs.map +1 -0
- package/_cjs/Push/Producer/SyncProducer.cjs +107 -0
- package/_cjs/Push/Producer/SyncProducer.cjs.map +1 -0
- package/_cjs/Push/Producer.cjs +2 -0
- package/_cjs/Push/Producer.cjs.map +1 -0
- package/_cjs/Push/Sink.cjs +219 -0
- package/_cjs/Push/Sink.cjs.map +1 -0
- package/_cjs/Push/api.cjs +340 -385
- package/_cjs/Push/api.cjs.map +1 -1
- package/_cjs/Push/definition.cjs +79 -22
- package/_cjs/Push/definition.cjs.map +1 -1
- package/_cjs/Push/internal.cjs +32 -28
- package/_cjs/Push/internal.cjs.map +1 -1
- package/_cjs/Push.cjs +66 -0
- package/_cjs/Push.cjs.map +1 -1
- package/_cjs/Queue/api/dimapIO.cjs +1 -2
- package/_cjs/Queue/api/dimapIO.cjs.map +1 -1
- package/_cjs/Queue/api/filterInputIO.cjs +1 -2
- package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
- package/_cjs/Queue/api/filterOutputIO.cjs +1 -2
- package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -1
- package/_cjs/Queue/api/poll.cjs +1 -2
- package/_cjs/Queue/api/poll.cjs.map +1 -1
- package/_cjs/Queue/api/takeBetween.cjs +1 -2
- package/_cjs/Queue/api/takeBetween.cjs.map +1 -1
- package/_cjs/Queue/api/takeN.cjs +1 -2
- package/_cjs/Queue/api/takeN.cjs.map +1 -1
- package/_cjs/Queue/api/zipWithIO.cjs +1 -2
- package/_cjs/Queue/api/zipWithIO.cjs.map +1 -1
- package/_cjs/Queue/constructors.cjs +1 -2
- package/_cjs/Queue/constructors.cjs.map +1 -1
- package/_cjs/Queue/internal.cjs +1 -2
- package/_cjs/Queue/internal.cjs.map +1 -1
- package/_cjs/Queue/strategy.cjs +1 -2
- package/_cjs/Queue/strategy.cjs.map +1 -1
- package/_cjs/Random/api.cjs +1 -2
- package/_cjs/Random/api.cjs.map +1 -1
- package/_cjs/Random/definition.cjs +2 -2
- package/_cjs/Random/definition.cjs.map +1 -1
- package/_cjs/Random/live.cjs +1 -2
- package/_cjs/Random/live.cjs.map +1 -1
- package/_cjs/Ref/Atomic.cjs +1 -2
- package/_cjs/Ref/Atomic.cjs.map +1 -1
- package/_cjs/Ref/Derived.cjs +1 -2
- package/_cjs/Ref/Derived.cjs.map +1 -1
- package/_cjs/Ref/DerivedAll.cjs +1 -2
- package/_cjs/Ref/DerivedAll.cjs.map +1 -1
- package/_cjs/Ref/Synchronized/api.cjs +2 -3
- package/_cjs/Ref/Synchronized/api.cjs.map +1 -1
- package/_cjs/Ref/Synchronized/constructors.cjs +2 -3
- package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -1
- package/_cjs/Ref/Synchronized/definition.cjs +13 -14
- package/_cjs/Ref/Synchronized/definition.cjs.map +1 -1
- package/_cjs/Ref/api/collect.cjs +1 -2
- package/_cjs/Ref/api/collect.cjs.map +1 -1
- package/_cjs/Ref/api/dimap.cjs +1 -2
- package/_cjs/Ref/api/dimap.cjs.map +1 -1
- package/_cjs/Ref/api/filter.cjs +1 -2
- package/_cjs/Ref/api/filter.cjs.map +1 -1
- package/_cjs/Ref/api/modify.cjs +1 -2
- package/_cjs/Ref/api/modify.cjs.map +1 -1
- package/_cjs/Ref/api.cjs +1 -2
- package/_cjs/Ref/api.cjs.map +1 -1
- package/_cjs/Ref/constructors.cjs +1 -2
- package/_cjs/Ref/constructors.cjs.map +1 -1
- package/_cjs/Ref/definition.cjs.map +1 -1
- package/_cjs/Reloadable/api.cjs +1 -2
- package/_cjs/Reloadable/api.cjs.map +1 -1
- package/_cjs/Reloadable/constructors.cjs +1 -2
- package/_cjs/Reloadable/constructors.cjs.map +1 -1
- package/_cjs/Reloadable/definition.cjs +1 -2
- package/_cjs/Reloadable/definition.cjs.map +1 -1
- package/_cjs/RuntimeFlags/Patch.cjs +1 -2
- package/_cjs/RuntimeFlags/Patch.cjs.map +1 -1
- package/_cjs/RuntimeFlags/RuntimeFlags.cjs +1 -2
- package/_cjs/RuntimeFlags/RuntimeFlags.cjs.map +1 -1
- package/_cjs/STM/api/atomically.cjs +1 -2
- package/_cjs/STM/api/atomically.cjs.map +1 -1
- package/_cjs/STM/api/core-api.cjs +1 -2
- package/_cjs/STM/api/core-api.cjs.map +1 -1
- package/_cjs/STM/api.cjs +1 -2
- package/_cjs/STM/api.cjs.map +1 -1
- package/_cjs/STM/definition.cjs +2 -3
- package/_cjs/STM/definition.cjs.map +1 -1
- package/_cjs/STM/driver.cjs +1 -2
- package/_cjs/STM/driver.cjs.map +1 -1
- package/_cjs/STM/internal/CommitState.cjs +1 -2
- package/_cjs/STM/internal/CommitState.cjs.map +1 -1
- package/_cjs/STM/internal/Journal.cjs +1 -2
- package/_cjs/STM/internal/Journal.cjs.map +1 -1
- package/_cjs/Schedule/Decision.cjs +1 -2
- package/_cjs/Schedule/Decision.cjs.map +1 -1
- package/_cjs/Schedule/api/driver.cjs +1 -2
- package/_cjs/Schedule/api/driver.cjs.map +1 -1
- package/_cjs/Schedule/api.cjs +1 -2
- package/_cjs/Schedule/api.cjs.map +1 -1
- package/_cjs/Scope/Finalizer/definition.cjs +1 -2
- package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +1 -2
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/api.cjs +1 -2
- package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -2
- package/_cjs/Scope/ReleaseMap/constructors.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap/definition.cjs +1 -2
- package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
- package/_cjs/Scope/api.cjs +29 -9
- package/_cjs/Scope/api.cjs.map +1 -1
- package/_cjs/Scope/definition.cjs +1 -2
- package/_cjs/Scope/definition.cjs.map +1 -1
- package/_cjs/ScopedRef/api.cjs +2 -3
- package/_cjs/ScopedRef/api.cjs.map +1 -1
- package/_cjs/Semaphore/Reservation.cjs +24 -0
- package/_cjs/Semaphore/Reservation.cjs.map +1 -0
- package/_cjs/Semaphore/constructors.cjs +25 -0
- package/_cjs/Semaphore/constructors.cjs.map +1 -0
- package/_cjs/Semaphore/definition.cjs +149 -0
- package/_cjs/Semaphore/definition.cjs.map +1 -0
- package/_cjs/Semaphore.cjs +31 -138
- package/_cjs/Semaphore.cjs.map +1 -1
- package/_cjs/Sink/api.cjs +1 -2
- package/_cjs/Sink/api.cjs.map +1 -1
- package/_cjs/Sink/definition.cjs +2 -3
- package/_cjs/Sink/definition.cjs.map +1 -1
- package/_cjs/State/api.cjs +1 -2
- package/_cjs/State/api.cjs.map +1 -1
- package/_cjs/Stream/api/zipAllWith.cjs +1 -2
- package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
- package/_cjs/Stream/api/zipWith.cjs +1 -2
- package/_cjs/Stream/api/zipWith.cjs.map +1 -1
- package/_cjs/Stream/api/zipWithChunks.cjs +1 -2
- package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
- package/_cjs/Stream/api.cjs +702 -703
- package/_cjs/Stream/api.cjs.map +1 -1
- package/_cjs/Stream/definition.cjs.map +1 -1
- package/_cjs/Stream/internal/Handoff.cjs +1 -2
- package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
- package/_cjs/Stream/internal/Pull.cjs +1 -2
- package/_cjs/Stream/internal/Pull.cjs.map +1 -1
- package/_cjs/Stream/internal/Take.cjs +1 -2
- package/_cjs/Stream/internal/Take.cjs.map +1 -1
- package/_cjs/Stream/internal/util.cjs +1 -2
- package/_cjs/Stream/internal/util.cjs.map +1 -1
- package/_cjs/Subject/Atomic.cjs +46 -12
- package/_cjs/Subject/Atomic.cjs.map +1 -1
- package/_cjs/Subject/DeferredRef.cjs +53 -0
- package/_cjs/Subject/DeferredRef.cjs.map +1 -0
- package/_cjs/Subject/Hold.cjs +41 -0
- package/_cjs/Subject/Hold.cjs.map +1 -0
- package/_cjs/Subject/RefSubject/Atomic.cjs +130 -0
- package/_cjs/Subject/RefSubject/Atomic.cjs.map +1 -0
- package/_cjs/Subject/RefSubject/Derived.cjs +98 -0
- package/_cjs/Subject/RefSubject/Derived.cjs.map +1 -0
- package/_cjs/Subject/RefSubject/RefSubject.cjs +19 -0
- package/_cjs/Subject/RefSubject/RefSubject.cjs.map +1 -0
- package/_cjs/Subject/api.cjs +1 -2
- package/_cjs/Subject/api.cjs.map +1 -1
- package/_cjs/Subject/definition.cjs +16 -1
- package/_cjs/Subject/definition.cjs.map +1 -1
- package/_cjs/Subject.cjs +22 -0
- package/_cjs/Subject.cjs.map +1 -1
- package/_cjs/SubscriptionRef.cjs +2 -4
- package/_cjs/SubscriptionRef.cjs.map +1 -1
- package/_cjs/Supervisor/api.cjs +1 -2
- package/_cjs/Supervisor/api.cjs.map +1 -1
- package/_cjs/Supervisor/constructors.cjs +1 -2
- package/_cjs/Supervisor/constructors.cjs.map +1 -1
- package/_cjs/Supervisor/definition.cjs +1 -2
- package/_cjs/Supervisor/definition.cjs.map +1 -1
- package/_cjs/SupervisorPatch.cjs +1 -2
- package/_cjs/SupervisorPatch.cjs.map +1 -1
- package/_cjs/TExit/definition.cjs +1 -2
- package/_cjs/TExit/definition.cjs.map +1 -1
- package/_cjs/TFuture/api.cjs +1 -2
- package/_cjs/TFuture/api.cjs.map +1 -1
- package/_cjs/TFuture/constructors.cjs +1 -2
- package/_cjs/TFuture/constructors.cjs.map +1 -1
- package/_cjs/TFuture/definition.cjs +1 -2
- package/_cjs/TFuture/definition.cjs.map +1 -1
- package/_cjs/TReentrantLock/api.cjs +1 -2
- package/_cjs/TReentrantLock/api.cjs.map +1 -1
- package/_cjs/TReentrantLock/definition.cjs +1 -2
- package/_cjs/TReentrantLock/definition.cjs.map +1 -1
- package/_cjs/TRef/api.cjs +1 -2
- package/_cjs/TRef/api.cjs.map +1 -1
- package/_cjs/TRef/constructors.cjs +1 -2
- package/_cjs/TRef/constructors.cjs.map +1 -1
- package/_cjs/TRef/definition.cjs +1 -2
- package/_cjs/TRef/definition.cjs.map +1 -1
- package/_cjs/TSemaphore/api.cjs +1 -2
- package/_cjs/TSemaphore/api.cjs.map +1 -1
- package/_cjs/TSemaphore/constructors.cjs +1 -2
- package/_cjs/TSemaphore/constructors.cjs.map +1 -1
- package/_cjs/TSemaphore/definition.cjs +1 -2
- package/_cjs/TSemaphore/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/filterIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/filterIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/findIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/mapIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +1 -2
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -1
- package/_cjs/data/Exit/foreachIO.cjs +1 -2
- package/_cjs/data/Exit/foreachIO.cjs.map +1 -1
- package/_cjs/internal/HashedPair.cjs +1 -2
- package/_cjs/internal/HashedPair.cjs.map +1 -1
- package/_cjs/internal/Hub.cjs +1 -2
- package/_cjs/internal/Hub.cjs.map +1 -1
- package/_cjs/internal/MutableQueue.cjs +1 -2
- package/_cjs/internal/MutableQueue.cjs.map +1 -1
- package/_cjs/internal/Scheduler.cjs +1 -2
- package/_cjs/internal/Scheduler.cjs.map +1 -1
- package/_cjs/internal/StackTraceBuilder.cjs +1 -2
- package/_cjs/internal/StackTraceBuilder.cjs.map +1 -1
- package/_mjs/Cached/api.mjs.map +1 -1
- package/_mjs/Channel/api/mapOutConcurrentIO.mjs +1 -1
- package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
- package/_mjs/Channel/api/runScoped.mjs +2 -2
- package/_mjs/Channel/api/runScoped.mjs.map +1 -1
- package/_mjs/Channel/api/toPull.mjs +1 -1
- package/_mjs/Channel/api/toPull.mjs.map +1 -1
- package/_mjs/Channel/api.mjs +205 -205
- package/_mjs/Channel/api.mjs.map +1 -1
- package/_mjs/Channel/core-api.mjs +43 -42
- package/_mjs/Channel/core-api.mjs.map +1 -1
- package/_mjs/Channel/internal/ChannelExecutor.mjs +3 -3
- package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
- package/_mjs/Console/definition.mjs +1 -0
- package/_mjs/Console/definition.mjs.map +1 -1
- package/_mjs/CountdownLatch.mjs +2 -1
- package/_mjs/CountdownLatch.mjs.map +1 -1
- package/_mjs/Fiber/FiberMessage.mjs +2 -20
- package/_mjs/Fiber/FiberMessage.mjs.map +1 -1
- package/_mjs/Fiber/FiberRuntime.mjs +877 -633
- package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
- package/_mjs/Fiber/api/collectAll.mjs +1 -1
- package/_mjs/Fiber/api/collectAll.mjs.map +1 -1
- package/_mjs/Fiber/api/interrupt.mjs +1 -1
- package/_mjs/Fiber/api/interrupt.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAll.mjs +1 -1
- package/_mjs/Fiber/api/interruptAll.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAs.mjs +4 -7
- package/_mjs/Fiber/api/interruptAs.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptFork.mjs +1 -1
- package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
- package/_mjs/Fiber/api/mapIO.mjs +1 -1
- package/_mjs/Fiber/api/mapIO.mjs.map +1 -1
- package/_mjs/Fiber/api/zipWith.mjs +1 -1
- package/_mjs/Fiber/api/zipWith.mjs.map +1 -1
- package/_mjs/Fiber/constructors.mjs +1 -1
- package/_mjs/Fiber/constructors.mjs.map +1 -1
- package/_mjs/Fiber/definition.mjs +5 -2
- package/_mjs/Fiber/definition.mjs.map +1 -1
- package/_mjs/FiberScope/definition.mjs +28 -4
- package/_mjs/FiberScope/definition.mjs.map +1 -1
- package/_mjs/FiberSet.mjs +14 -12
- package/_mjs/FiberSet.mjs.map +1 -1
- package/_mjs/Future/State.mjs +96 -0
- package/_mjs/Future/State.mjs.map +1 -0
- package/_mjs/Future/api.mjs +67 -61
- package/_mjs/Future/api.mjs.map +1 -1
- package/_mjs/Future/constructors.mjs +3 -3
- package/_mjs/Future/constructors.mjs.map +1 -1
- package/_mjs/Future/definition.mjs +0 -12
- package/_mjs/Future/definition.mjs.map +1 -1
- package/_mjs/Future.mjs +1 -0
- package/_mjs/Future.mjs.map +1 -1
- package/_mjs/Hub/api.mjs +55 -55
- package/_mjs/Hub/api.mjs.map +1 -1
- package/_mjs/IO/api/array.mjs +42 -0
- package/_mjs/IO/api/array.mjs.map +1 -0
- package/_mjs/IO/api/asyncInterrupt.mjs.map +1 -1
- package/_mjs/IO/api/awaitAllChildren.mjs +10 -0
- package/_mjs/IO/api/awaitAllChildren.mjs.map +1 -0
- package/_mjs/IO/api/cachedInvalidate.mjs +39 -0
- package/_mjs/IO/api/cachedInvalidate.mjs.map +1 -0
- package/_mjs/IO/api/disconnect.mjs +1 -1
- package/_mjs/IO/api/disconnect.mjs.map +1 -1
- package/_mjs/IO/api/foreachConcurrent.mjs +35 -28
- package/_mjs/IO/api/foreachConcurrent.mjs.map +1 -1
- package/_mjs/IO/api/foreachExec.mjs +27 -4
- package/_mjs/IO/api/foreachExec.mjs.map +1 -1
- package/_mjs/IO/api/fork.mjs +1 -1
- package/_mjs/IO/api/fork.mjs.map +1 -1
- package/_mjs/IO/api/forkDaemon.mjs +4 -4
- package/_mjs/IO/api/forkDaemon.mjs.map +1 -1
- package/_mjs/IO/api/interrupt.mjs +3 -3
- package/_mjs/IO/api/onTermination.mjs +1 -1
- package/_mjs/IO/api/onTermination.mjs.map +1 -1
- package/_mjs/IO/api/race.mjs +1 -1
- package/_mjs/IO/api/race.mjs.map +1 -1
- package/_mjs/IO/api/timeout.mjs +8 -9
- package/_mjs/IO/api/timeout.mjs.map +1 -1
- package/_mjs/IO/api/transplant.mjs +19 -5
- package/_mjs/IO/api/transplant.mjs.map +1 -1
- package/_mjs/IO/api/zipConcurrent.mjs +4 -4
- package/_mjs/IO/api/zipConcurrent.mjs.map +1 -1
- package/_mjs/IO/api.mjs +515 -468
- package/_mjs/IO/api.mjs.map +1 -1
- package/_mjs/IO/definition.mjs +1 -1
- package/_mjs/IO/definition.mjs.map +1 -1
- package/_mjs/IO/runtime.mjs +8 -8
- package/_mjs/IO/runtime.mjs.map +1 -1
- package/_mjs/IO.mjs +3 -1
- package/_mjs/IO.mjs.map +1 -1
- package/_mjs/IOEnv/definition.mjs.map +1 -1
- package/_mjs/Push/Bounds.mjs +2 -0
- package/_mjs/Push/Bounds.mjs.map +1 -0
- package/_mjs/Push/FlattenStrategy.mjs +86 -0
- package/_mjs/Push/FlattenStrategy.mjs.map +1 -0
- package/_mjs/Push/IndexedBuffer.mjs +61 -0
- package/_mjs/Push/IndexedBuffer.mjs.map +1 -0
- package/_mjs/Push/MergeStrategy.mjs +34 -0
- package/_mjs/Push/MergeStrategy.mjs.map +1 -0
- package/_mjs/Push/Operator/IOLoopOperator.mjs +208 -0
- package/_mjs/Push/Operator/IOLoopOperator.mjs.map +1 -0
- package/_mjs/Push/Operator/IOOperator.mjs +91 -0
- package/_mjs/Push/Operator/IOOperator.mjs.map +1 -0
- package/_mjs/Push/Operator/LoopOperator.mjs +151 -0
- package/_mjs/Push/Operator/LoopOperator.mjs.map +1 -0
- package/_mjs/Push/Operator/SyncOperator.mjs +67 -0
- package/_mjs/Push/Operator/SyncOperator.mjs.map +1 -0
- package/_mjs/Push/Operator.mjs +2 -0
- package/_mjs/Push/Operator.mjs.map +1 -0
- package/_mjs/Push/Producer/IOProducer.mjs +55 -0
- package/_mjs/Push/Producer/IOProducer.mjs.map +1 -0
- package/_mjs/Push/Producer/SyncProducer.mjs +90 -0
- package/_mjs/Push/Producer/SyncProducer.mjs.map +1 -0
- package/_mjs/Push/Producer.mjs +2 -0
- package/_mjs/Push/Producer.mjs.map +1 -0
- package/_mjs/Push/Sink.mjs +206 -0
- package/_mjs/Push/Sink.mjs.map +1 -0
- package/_mjs/Push/api.mjs +311 -344
- package/_mjs/Push/api.mjs.map +1 -1
- package/_mjs/Push/definition.mjs +73 -18
- package/_mjs/Push/definition.mjs.map +1 -1
- package/_mjs/Push/internal.mjs +30 -26
- package/_mjs/Push/internal.mjs.map +1 -1
- package/_mjs/Push.mjs +7 -1
- package/_mjs/Push.mjs.map +1 -1
- package/_mjs/Random/definition.mjs +1 -0
- package/_mjs/Random/definition.mjs.map +1 -1
- package/_mjs/Ref/Synchronized/api.mjs +1 -1
- package/_mjs/Ref/Synchronized/api.mjs.map +1 -1
- package/_mjs/Ref/Synchronized/constructors.mjs +1 -1
- package/_mjs/Ref/Synchronized/definition.mjs +12 -12
- package/_mjs/Ref/Synchronized/definition.mjs.map +1 -1
- package/_mjs/Ref/definition.mjs.map +1 -1
- package/_mjs/STM/definition.mjs +1 -1
- package/_mjs/Scope/api.mjs +22 -4
- package/_mjs/Scope/api.mjs.map +1 -1
- package/_mjs/ScopedRef/api.mjs +1 -1
- package/_mjs/ScopedRef/api.mjs.map +1 -1
- package/_mjs/Semaphore/Reservation.mjs +16 -0
- package/_mjs/Semaphore/Reservation.mjs.map +1 -0
- package/_mjs/Semaphore/constructors.mjs +17 -0
- package/_mjs/Semaphore/constructors.mjs.map +1 -0
- package/_mjs/Semaphore/definition.mjs +141 -0
- package/_mjs/Semaphore/definition.mjs.map +1 -0
- package/_mjs/Semaphore.mjs +4 -133
- package/_mjs/Semaphore.mjs.map +1 -1
- package/_mjs/Sink/definition.mjs +2 -3
- package/_mjs/Sink/definition.mjs.map +1 -1
- package/_mjs/Stream/api.mjs +701 -701
- package/_mjs/Stream/api.mjs.map +1 -1
- package/_mjs/Stream/definition.mjs.map +1 -1
- package/_mjs/Subject/Atomic.mjs +46 -10
- package/_mjs/Subject/Atomic.mjs.map +1 -1
- package/_mjs/Subject/DeferredRef.mjs +45 -0
- package/_mjs/Subject/DeferredRef.mjs.map +1 -0
- package/_mjs/Subject/Hold.mjs +33 -0
- package/_mjs/Subject/Hold.mjs.map +1 -0
- package/_mjs/Subject/RefSubject/Atomic.mjs +122 -0
- package/_mjs/Subject/RefSubject/Atomic.mjs.map +1 -0
- package/_mjs/Subject/RefSubject/Derived.mjs +90 -0
- package/_mjs/Subject/RefSubject/Derived.mjs.map +1 -0
- package/_mjs/Subject/RefSubject/RefSubject.mjs +12 -0
- package/_mjs/Subject/RefSubject/RefSubject.mjs.map +1 -0
- package/_mjs/Subject/definition.mjs +14 -0
- package/_mjs/Subject/definition.mjs.map +1 -1
- package/_mjs/Subject.mjs +2 -0
- package/_mjs/Subject.mjs.map +1 -1
- package/_mjs/SubscriptionRef.mjs +1 -2
- package/_mjs/SubscriptionRef.mjs.map +1 -1
- package/_src/Cached/api.ts +3 -3
- package/_src/Channel/api/toPull.ts +1 -1
- package/_src/Channel/api.ts +273 -272
- package/_src/Channel/core-api.ts +57 -55
- package/_src/Channel/internal/ChannelExecutor.ts +3 -3
- package/_src/Console/definition.ts +1 -0
- package/_src/CountdownLatch.ts +2 -0
- package/_src/Fiber/FiberMessage.ts +3 -28
- package/_src/Fiber/FiberRuntime.ts +988 -616
- package/_src/Fiber/api/interruptAs.ts +4 -3
- package/_src/Fiber/constructors.ts +1 -1
- package/_src/Fiber/definition.ts +4 -0
- package/_src/FiberScope/definition.ts +40 -2
- package/_src/FiberSet.ts +6 -2
- package/_src/Future/State.ts +128 -0
- package/_src/Future/api.ts +62 -51
- package/_src/Future/constructors.ts +4 -2
- package/_src/Future/definition.ts +2 -17
- package/_src/Future.ts +4 -3
- package/_src/Hub/api.ts +61 -61
- package/_src/IO/api/addFinalizerExit.ts +4 -4
- package/_src/IO/api/array.ts +49 -0
- package/_src/IO/api/asyncInterrupt.ts +1 -1
- package/_src/IO/api/awaitAllChildren.ts +6 -0
- package/_src/IO/api/cachedInvalidate.ts +42 -0
- package/_src/IO/api/foreachConcurrent.ts +39 -23
- package/_src/IO/api/foreachExec.ts +47 -0
- package/_src/IO/api/fork.ts +1 -1
- package/_src/IO/api/forkDaemon.ts +2 -2
- package/_src/IO/api/memoize.ts +3 -3
- package/_src/IO/api/onTermination.ts +2 -2
- package/_src/IO/api/transplant.ts +26 -3
- package/_src/IO/api/zipConcurrent.ts +2 -2
- package/_src/IO/api.ts +547 -525
- package/_src/IO/definition.ts +4 -28
- package/_src/IO/runtime.ts +0 -1
- package/_src/IO.ts +65 -63
- package/_src/IOEnv/definition.ts +1 -4
- package/_src/Push/Bounds.ts +4 -0
- package/_src/Push/FlattenStrategy.ts +137 -0
- package/_src/Push/IndexedBuffer.ts +79 -0
- package/_src/Push/MergeStrategy.ts +59 -0
- package/_src/Push/Operator/IOLoopOperator.ts +413 -0
- package/_src/Push/Operator/IOOperator.ts +173 -0
- package/_src/Push/Operator/LoopOperator.ts +242 -0
- package/_src/Push/Operator/SyncOperator.ts +107 -0
- package/_src/Push/Operator.ts +7 -0
- package/_src/Push/Producer/IOProducer.ts +83 -0
- package/_src/Push/Producer/SyncProducer.ts +105 -0
- package/_src/Push/Producer.ts +0 -0
- package/_src/Push/Sink.ts +302 -0
- package/_src/Push/api.ts +387 -513
- package/_src/Push/definition.ts +216 -23
- package/_src/Push/internal.ts +11 -0
- package/_src/Push.ts +7 -1
- package/_src/Random/definition.ts +1 -0
- package/_src/Ref/Synchronized/api.ts +2 -2
- package/_src/Ref/Synchronized/definition.ts +82 -38
- package/_src/Ref/definition.ts +26 -0
- package/_src/Scope/api.ts +22 -0
- package/_src/Semaphore/Reservation.ts +15 -0
- package/_src/Semaphore/constructors.ts +14 -0
- package/_src/Semaphore/definition.ts +180 -0
- package/_src/Semaphore.ts +5 -159
- package/_src/Sink/definition.ts +4 -5
- package/_src/Stream/api.ts +679 -679
- package/_src/Stream/definition.ts +0 -1
- package/_src/Subject/Atomic.ts +68 -11
- package/_src/Subject/DeferredRef.ts +44 -0
- package/_src/Subject/Hold.ts +48 -0
- package/_src/Subject/RefSubject/Atomic.ts +193 -0
- package/_src/Subject/RefSubject/Derived.ts +179 -0
- package/_src/Subject/RefSubject/RefSubject.ts +90 -0
- package/_src/Subject/definition.ts +21 -3
- package/_src/Subject.ts +5 -3
- package/_src/SubscriptionRef.ts +1 -1
- package/_src/index.ts +49 -50
- package/index.d.ts +0 -1
- package/package.json +4 -4
- package/IO/api/sequenceT.d.ts +0 -26
- package/RefSubject/Atomic.d.ts +0 -34
- package/RefSubject/Synchronized/api.d.ts +0 -9
- package/RefSubject/Synchronized/definition.d.ts +0 -39
- package/RefSubject/api.d.ts +0 -120
- package/RefSubject/definition.d.ts +0 -52
- package/RefSubject.d.ts +0 -3
- package/_cjs/IO/api/sequenceT.cjs +0 -18
- package/_cjs/IO/api/sequenceT.cjs.map +0 -1
- package/_cjs/RefSubject/Atomic.cjs +0 -108
- package/_cjs/RefSubject/Atomic.cjs.map +0 -1
- package/_cjs/RefSubject/Synchronized/api.cjs +0 -23
- package/_cjs/RefSubject/Synchronized/api.cjs.map +0 -1
- package/_cjs/RefSubject/Synchronized/definition.cjs +0 -56
- package/_cjs/RefSubject/Synchronized/definition.cjs.map +0 -1
- package/_cjs/RefSubject/api.cjs +0 -252
- package/_cjs/RefSubject/api.cjs.map +0 -1
- package/_cjs/RefSubject/definition.cjs +0 -26
- package/_cjs/RefSubject/definition.cjs.map +0 -1
- package/_cjs/RefSubject.cjs +0 -39
- package/_cjs/RefSubject.cjs.map +0 -1
- package/_mjs/IO/api/sequenceT.mjs +0 -10
- package/_mjs/IO/api/sequenceT.mjs.map +0 -1
- package/_mjs/RefSubject/Atomic.mjs +0 -99
- package/_mjs/RefSubject/Atomic.mjs.map +0 -1
- package/_mjs/RefSubject/Synchronized/api.mjs +0 -15
- package/_mjs/RefSubject/Synchronized/api.mjs.map +0 -1
- package/_mjs/RefSubject/Synchronized/definition.mjs +0 -47
- package/_mjs/RefSubject/Synchronized/definition.mjs.map +0 -1
- package/_mjs/RefSubject/api.mjs +0 -229
- package/_mjs/RefSubject/api.mjs.map +0 -1
- package/_mjs/RefSubject/definition.mjs +0 -19
- package/_mjs/RefSubject/definition.mjs.map +0 -1
- package/_mjs/RefSubject.mjs +0 -5
- package/_mjs/RefSubject.mjs.map +0 -1
- package/_src/IO/api/sequenceT.ts +0 -16
- package/_src/RefSubject/Atomic.ts +0 -129
- package/_src/RefSubject/Synchronized/api.ts +0 -14
- package/_src/RefSubject/Synchronized/definition.ts +0 -76
- package/_src/RefSubject/api.ts +0 -253
- package/_src/RefSubject/definition.ts +0 -70
- package/_src/RefSubject.ts +0 -5
package/_src/Subject/Atomic.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { Scope } from "../Scope.js";
|
|
2
|
+
import type { Push } from "@fncts/io/Push";
|
|
3
|
+
import type { UnsafeSink } from "@fncts/io/Push/Sink";
|
|
3
4
|
|
|
4
|
-
import {
|
|
5
|
+
import { HashSet as MutableHashSet } from "@fncts/base/collection/mutable/HashSet";
|
|
5
6
|
import { PushTypeId, PushVariance } from "@fncts/io/Push/definition";
|
|
7
|
+
import { withScope } from "@fncts/io/Push/internal";
|
|
8
|
+
import { PSubject } from "@fncts/io/Subject/definition";
|
|
6
9
|
import { SubjectTypeId } from "@fncts/io/Subject/definition";
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
import { IO } from "../IO.js";
|
|
12
|
+
|
|
13
|
+
export class AtomicSubject<E, A> extends PSubject<Scope, never, E, E, A, A> {
|
|
9
14
|
readonly [SubjectTypeId]: SubjectTypeId = SubjectTypeId;
|
|
10
15
|
readonly [PushTypeId]: PushTypeId = PushTypeId;
|
|
11
16
|
declare [PushVariance]: {
|
|
@@ -14,17 +19,69 @@ export class AtomicSubject<E, A> implements Subject<never, E, A> {
|
|
|
14
19
|
readonly _A: (_: never) => A;
|
|
15
20
|
};
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
get subscribers(): number {
|
|
23
|
+
return this.sinks.size;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
protected sinks = MutableHashSet.empty<readonly [UnsafeSink<any, E, A>, Environment<any>, Scope.Closeable]>();
|
|
27
|
+
|
|
28
|
+
protected interruptScopes = IO.fiberIdWith((fiberId) =>
|
|
29
|
+
this.sinks.foreachDiscardIO(([, , scope]) => scope.close(Exit.interrupt(fiberId))),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
readonly interrupt = this.interruptScopes;
|
|
33
|
+
|
|
34
|
+
run<R1>(sink: UnsafeSink<R1, E, A>): IO<Scope | R1, never, void> {
|
|
35
|
+
return this.addSink(sink, (scope) => scope.awaitClose);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
onSuccess(value: A): IO<never, never, void> {
|
|
39
|
+
return IO.defer(this.unsafeOnSuccess(value));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
onFailure(cause: Cause<E>): IO<never, never, void> {
|
|
43
|
+
return IO.defer(this.unsafeOnFailure(cause));
|
|
44
|
+
}
|
|
18
45
|
|
|
19
|
-
|
|
20
|
-
|
|
46
|
+
protected addSink<R, R1, B>(
|
|
47
|
+
sink: UnsafeSink<R, E, A>,
|
|
48
|
+
f: (scope: Scope) => IO<R1, never, B>,
|
|
49
|
+
): IO<Scope | R1, never, B> {
|
|
50
|
+
return withScope(
|
|
51
|
+
(innerScope) =>
|
|
52
|
+
IO.environmentWithIO((environment) => {
|
|
53
|
+
const entry = [sink, environment, innerScope] as const;
|
|
54
|
+
this.sinks.add(entry);
|
|
55
|
+
const remove = IO(this.sinks.remove(entry));
|
|
56
|
+
return innerScope.addFinalizer(remove) > f(innerScope);
|
|
57
|
+
}),
|
|
58
|
+
ExecutionStrategy.sequential,
|
|
59
|
+
);
|
|
21
60
|
}
|
|
22
61
|
|
|
23
|
-
|
|
24
|
-
|
|
62
|
+
protected unsafeOnSuccess(a: A) {
|
|
63
|
+
if (this.sinks.size === 0) {
|
|
64
|
+
return IO.unit;
|
|
65
|
+
} else {
|
|
66
|
+
return this.sinks.foreachDiscardIO(([sink, environment]) =>
|
|
67
|
+
sink
|
|
68
|
+
.onSuccess(a)
|
|
69
|
+
.catchAllCause((cause) => sink.onFailure(cause))
|
|
70
|
+
.provideSomeEnvironment(environment),
|
|
71
|
+
);
|
|
72
|
+
}
|
|
25
73
|
}
|
|
26
74
|
|
|
27
|
-
|
|
28
|
-
|
|
75
|
+
protected unsafeOnFailure(cause: Cause<E>) {
|
|
76
|
+
if (this.sinks.size === 0) {
|
|
77
|
+
return IO.unit;
|
|
78
|
+
} else {
|
|
79
|
+
return this.sinks.foreachDiscardIO(([sink, environment, scope]) =>
|
|
80
|
+
sink
|
|
81
|
+
.onFailure(cause)
|
|
82
|
+
.catchAllCause((error) => scope.close(Exit.failCause(error)))
|
|
83
|
+
.provideSomeEnvironment(environment),
|
|
84
|
+
);
|
|
85
|
+
}
|
|
29
86
|
}
|
|
30
87
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { AtomicReference } from "@fncts/base/internal/AtomicReference";
|
|
2
|
+
|
|
3
|
+
import { External, IO } from "../IO.js";
|
|
4
|
+
|
|
5
|
+
export class FutureRef<E, A> extends External<never, E, A> {
|
|
6
|
+
public version = -1;
|
|
7
|
+
public future!: Future<E, A>;
|
|
8
|
+
|
|
9
|
+
constructor(
|
|
10
|
+
readonly fiberId: FiberId,
|
|
11
|
+
readonly current: AtomicReference<Maybe<Exit<E, A>>>,
|
|
12
|
+
) {
|
|
13
|
+
super();
|
|
14
|
+
this.reset();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
toIO: IO<never, E, A> = IO.defer(() => {
|
|
18
|
+
const current = this.current.get;
|
|
19
|
+
if (current.isNothing()) {
|
|
20
|
+
return this.future.await;
|
|
21
|
+
} else {
|
|
22
|
+
return current.value!;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
done(exit: Exit<E, A>) {
|
|
27
|
+
const current = this.current.get;
|
|
28
|
+
if (current.isJust() && Equatable.strictEquals(current.value, exit)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
this.future.unsafeDone(exit);
|
|
32
|
+
this.version += 1;
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
reset() {
|
|
37
|
+
this.current.set(Nothing());
|
|
38
|
+
this.version = -1;
|
|
39
|
+
if (this.future) {
|
|
40
|
+
this.future.unsafeDone(Exit.interrupt(this.fiberId));
|
|
41
|
+
}
|
|
42
|
+
this.future = Future.unsafeMake(this.fiberId);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Scope } from "../Scope.js";
|
|
2
|
+
import type { Subject } from "../Subject.js";
|
|
3
|
+
import type { Cause } from "@fncts/base/data/Cause";
|
|
4
|
+
import type { UnsafeSink } from "@fncts/io/Push/Sink";
|
|
5
|
+
|
|
6
|
+
import { AtomicReference } from "@fncts/base/internal/AtomicReference";
|
|
7
|
+
|
|
8
|
+
import { IO } from "../IO.js";
|
|
9
|
+
import { AtomicSubject } from "./Atomic.js";
|
|
10
|
+
|
|
11
|
+
export interface Hold<E, A> extends Subject<never, E, A> {
|
|
12
|
+
value: AtomicReference<Maybe<Exit<E, A>>>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class HoldSubject<E, A> extends AtomicSubject<E, A> implements Hold<E, A> {
|
|
16
|
+
readonly value: AtomicReference<Maybe<Exit<E, A>>> = new AtomicReference(Nothing());
|
|
17
|
+
|
|
18
|
+
onSuccess(value: A): IO<never, never, void> {
|
|
19
|
+
return IO.defer(() => {
|
|
20
|
+
this.value.set(Just(Exit.succeed(value)));
|
|
21
|
+
return this.unsafeOnSuccess(value);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
onFailure(cause: Cause<E>): IO<never, never, void> {
|
|
26
|
+
return IO.defer(() => {
|
|
27
|
+
this.value.set(Just(Exit.failCause(cause)));
|
|
28
|
+
return this.unsafeOnFailure(cause);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
run<R1>(sink: UnsafeSink<R1, E, A>): IO<Scope | R1, never, void> {
|
|
33
|
+
return this.addSink(
|
|
34
|
+
sink,
|
|
35
|
+
(scope) =>
|
|
36
|
+
this.value.get.match(
|
|
37
|
+
() => IO.unit,
|
|
38
|
+
(exit) =>
|
|
39
|
+
exit.match(
|
|
40
|
+
(cause) => sink.onFailure(cause),
|
|
41
|
+
(value) => sink.onSuccess(value),
|
|
42
|
+
),
|
|
43
|
+
) > scope.awaitClose,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interrupt: IO<never, never, void> = this.interruptScopes > IO(this.value.set(Nothing()));
|
|
48
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import type { Runtime } from "@fncts/io/IO/runtime";
|
|
2
|
+
import type { UnsafeSink } from "@fncts/io/Push/Sink";
|
|
3
|
+
import type { Scope } from "@fncts/io/Scope";
|
|
4
|
+
|
|
5
|
+
import { IO } from "@fncts/io/IO";
|
|
6
|
+
import { PSynchronizedInternal } from "@fncts/io/Ref/Synchronized/definition";
|
|
7
|
+
|
|
8
|
+
import { FutureRef } from "../DeferredRef.js";
|
|
9
|
+
import { HoldSubject } from "../Hold.js";
|
|
10
|
+
import { Derived } from "./Derived.js";
|
|
11
|
+
import { PRefSubject } from "./RefSubject.js";
|
|
12
|
+
|
|
13
|
+
export class Atomic<R, E, A> extends PRefSubject<never, never, E, E, E, A, A> {
|
|
14
|
+
constructor(
|
|
15
|
+
readonly fiberId: FiberId,
|
|
16
|
+
readonly initial: IO<R, E, A>,
|
|
17
|
+
readonly runtime: Runtime<R>,
|
|
18
|
+
readonly scope: Scope.Closeable,
|
|
19
|
+
) {
|
|
20
|
+
super();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
readonly semaphore = Semaphore.unsafeMake(1);
|
|
24
|
+
private subject = new HoldSubject<E, A>();
|
|
25
|
+
private futureRef = new FutureRef(this.fiberId, this.subject.value);
|
|
26
|
+
private fiber: Fiber<E, A> | null = null;
|
|
27
|
+
|
|
28
|
+
readonly interrupt = IO.fiberIdWith((fiberId) => {
|
|
29
|
+
this.futureRef.reset();
|
|
30
|
+
return this.scope.close(Exit.interrupt(fiberId)) > this.interruptFiber > this.subject.interrupt;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
readonly subscribers = this.subject.subscribers;
|
|
34
|
+
|
|
35
|
+
run<R1>(sink: UnsafeSink<R1, E, A>): IO<Scope | R1, never, void> {
|
|
36
|
+
return this.subject.run(sink);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
onFailure(cause: Cause<E>): IO<never, never, void> {
|
|
40
|
+
const exit = Exit.failCause(cause);
|
|
41
|
+
return IO.defer(() => {
|
|
42
|
+
if (this.futureRef.done(exit)) {
|
|
43
|
+
return this.sendEvent(exit);
|
|
44
|
+
} else {
|
|
45
|
+
return IO.unit;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
onSuccess = this.set;
|
|
51
|
+
|
|
52
|
+
modify<C>(f: (a: A) => readonly [C, A], __tsplusTrace?: string): IO<never, E, C> {
|
|
53
|
+
return this.get.flatMap((a) => {
|
|
54
|
+
const [c, a1] = f(a);
|
|
55
|
+
return this.set(a1).as(c);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
modifyIO<R1, E1, B>(f: (a: A) => IO<R1, E1, readonly [B, A]>, __tsplusTrace?: string): IO<R1, E1 | E, B> {
|
|
60
|
+
return this.get.flatMap(f).flatMap(([b, a]) => this.set(a).as(b));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
match<EC, ED, C, D>(
|
|
64
|
+
setError: (_: E) => EC,
|
|
65
|
+
getError: (_: E) => ED,
|
|
66
|
+
set: (_: C) => Either<EC, A>,
|
|
67
|
+
get: (_: A) => Either<ED, D>,
|
|
68
|
+
__tsplusTrace?: string,
|
|
69
|
+
): PSynchronizedInternal<never, never, EC, ED, C, D> {
|
|
70
|
+
return this.matchIO(setError, getError, set, get);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
matchAll<EC, ED, C, D>(
|
|
74
|
+
setError: (_: E) => EC,
|
|
75
|
+
getError: (_: E) => ED,
|
|
76
|
+
setGetError: (_: E) => EC,
|
|
77
|
+
set: (_: C) => (_: A) => Either<EC, A>,
|
|
78
|
+
get: (_: A) => Either<ED, D>,
|
|
79
|
+
__tsplusTrace?: string,
|
|
80
|
+
): PSynchronizedInternal<never, never, EC, ED, C, D> {
|
|
81
|
+
return this.matchAllIO(setError, getError, setGetError, set, get);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
matchIO<RC, RD, EC, ED, C, D>(
|
|
85
|
+
setError: (_: E) => EC,
|
|
86
|
+
getError: (_: E) => ED,
|
|
87
|
+
set: (_: C) => IO<RC, EC, A>,
|
|
88
|
+
get: (_: A) => IO<RD, ED, D>,
|
|
89
|
+
__tsplusTrace?: string,
|
|
90
|
+
): PSynchronizedInternal<RC, RD, EC, ED, C, D> {
|
|
91
|
+
return new PSynchronizedInternal(
|
|
92
|
+
this.semaphore,
|
|
93
|
+
this.get.matchIO((e) => IO.failNow(getError(e)), get),
|
|
94
|
+
(c) => set(c).flatMap((a) => this.set(a).mapError(setError)),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
matchAllIO<RC, RD, EC, ED, C, D>(
|
|
99
|
+
setError: (_: E) => EC,
|
|
100
|
+
getError: (_: E) => ED,
|
|
101
|
+
setGetError: (_: E) => EC,
|
|
102
|
+
set: (_: C) => (_: A) => IO<RC, EC, A>,
|
|
103
|
+
get: (_: A) => IO<RD, ED, D>,
|
|
104
|
+
__tsplusTrace?: string,
|
|
105
|
+
): PSynchronizedInternal<RC, RD, EC, ED, C, D> {
|
|
106
|
+
return new PSynchronizedInternal(
|
|
107
|
+
this.semaphore,
|
|
108
|
+
this.get.matchIO((e) => IO.failNow(getError(e)), get),
|
|
109
|
+
(c) =>
|
|
110
|
+
this.get.matchIO(
|
|
111
|
+
(e) => IO.failNow(setGetError(e)),
|
|
112
|
+
(b) => set(c)(b).flatMap((a) => this.set(a).mapError(setError)),
|
|
113
|
+
),
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
matchIOSubject<RC, RD, EI, EC, ED, C, D>(
|
|
118
|
+
mapSetError: (_: E) => EC,
|
|
119
|
+
mapGetError: (_: E) => ED,
|
|
120
|
+
mapErrorInput: (_: EI) => E,
|
|
121
|
+
mapSetErrorInput: (_: EC) => E,
|
|
122
|
+
mapSet: (_: C) => IO<RC, EC, A>,
|
|
123
|
+
mapGet: (_: A) => IO<RD, ED, D>,
|
|
124
|
+
__tsplusTrace?: string,
|
|
125
|
+
): PRefSubject<RC, RD, EI, ED, EC, C, D> {
|
|
126
|
+
return new Derived((f) =>
|
|
127
|
+
f({
|
|
128
|
+
ref: this,
|
|
129
|
+
mapSetError,
|
|
130
|
+
mapGetError,
|
|
131
|
+
mapErrorInput,
|
|
132
|
+
mapSetErrorInput,
|
|
133
|
+
mapSet,
|
|
134
|
+
mapGet,
|
|
135
|
+
}),
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
set(a: A, __tsplusTrace?: string): IO<never, never, void> {
|
|
140
|
+
const exit = Exit.succeed(a);
|
|
141
|
+
return IO.defer(() => {
|
|
142
|
+
if (this.futureRef.done(exit)) {
|
|
143
|
+
return this.sendEvent(exit);
|
|
144
|
+
} else {
|
|
145
|
+
return IO.unit;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
get get(): IO<never, E, A> {
|
|
151
|
+
return this.getOrInit(false);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
private sendEvent(exit: Exit<E, A>) {
|
|
155
|
+
return exit.match(
|
|
156
|
+
(cause) => this.subject.onFailure(cause).provideEnvironment(this.runtime.environment),
|
|
157
|
+
(value) => this.subject.onSuccess(value).provideEnvironment(this.runtime.environment),
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
private getOrInit(lock: boolean) {
|
|
162
|
+
return IO.defer(() => {
|
|
163
|
+
if (this.fiber === null && this.futureRef.current.get.isNothing()) {
|
|
164
|
+
return this.init(lock) > this.futureRef;
|
|
165
|
+
} else {
|
|
166
|
+
return this.futureRef;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
private interruptFiber = IO.defer(() => {
|
|
172
|
+
if (this.fiber) {
|
|
173
|
+
return this.fiber.interrupt;
|
|
174
|
+
} else {
|
|
175
|
+
return IO.unit;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
private init(lock: boolean) {
|
|
180
|
+
const maybeWithLock = lock ? this.semaphore.withPermits(1) : Function.identity;
|
|
181
|
+
|
|
182
|
+
const initialize = maybeWithLock(
|
|
183
|
+
this.initial.provideEnvironment(this.runtime.environment).onExit((exit) =>
|
|
184
|
+
IO(() => {
|
|
185
|
+
this.fiber = null;
|
|
186
|
+
this.futureRef.done(exit);
|
|
187
|
+
}),
|
|
188
|
+
),
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
return initialize.forkIn(this.scope).flatMap((fiber) => IO((this.fiber = fiber)));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type { Atomic } from "./Atomic.js";
|
|
2
|
+
import type { Cause } from "@fncts/base/data/Cause";
|
|
3
|
+
import type { Either } from "@fncts/base/data/Either";
|
|
4
|
+
import type { UnsafeSink } from "@fncts/io/Push/Sink";
|
|
5
|
+
import type { PRef } from "@fncts/io/Ref";
|
|
6
|
+
import type { Scope } from "@fncts/io/Scope";
|
|
7
|
+
|
|
8
|
+
import { IO } from "@fncts/io/IO";
|
|
9
|
+
import { Sink } from "@fncts/io/Push/Sink";
|
|
10
|
+
import { type PSynchronized, PSynchronizedInternal } from "@fncts/io/Ref";
|
|
11
|
+
|
|
12
|
+
import { PRefSubject } from "./RefSubject.js";
|
|
13
|
+
|
|
14
|
+
export class Derived<EnvIn, EnvOut, ErrIn, ErrOut, ErrInRef, In, Out> extends PRefSubject<
|
|
15
|
+
EnvIn,
|
|
16
|
+
EnvOut,
|
|
17
|
+
ErrIn,
|
|
18
|
+
ErrOut,
|
|
19
|
+
ErrInRef,
|
|
20
|
+
In,
|
|
21
|
+
Out
|
|
22
|
+
> {
|
|
23
|
+
constructor(
|
|
24
|
+
readonly use: <X>(
|
|
25
|
+
f: <R, E0, A0>(_: {
|
|
26
|
+
ref: Atomic<R, E0, A0>;
|
|
27
|
+
mapSetError: (_: E0) => ErrInRef;
|
|
28
|
+
mapGetError: (_: E0) => ErrOut;
|
|
29
|
+
mapErrorInput: (_: ErrIn) => E0;
|
|
30
|
+
mapSetErrorInput: (_: ErrInRef) => E0;
|
|
31
|
+
mapSet: (a: In) => IO<EnvIn, ErrInRef, A0>;
|
|
32
|
+
mapGet: (a: A0) => IO<EnvOut, ErrOut, Out>;
|
|
33
|
+
}) => X,
|
|
34
|
+
) => X,
|
|
35
|
+
) {
|
|
36
|
+
super();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
subscribers = this.use(({ ref }) => ref.subscribers);
|
|
40
|
+
interrupt = this.use(({ ref }) => ref.interrupt);
|
|
41
|
+
|
|
42
|
+
onSuccess(value: In): IO<EnvIn, never, void> {
|
|
43
|
+
return this.use(({ ref, mapSetErrorInput, mapSet }) =>
|
|
44
|
+
mapSet(value).matchCauseIO(
|
|
45
|
+
(cause) => ref.onFailure(cause.map(mapSetErrorInput)),
|
|
46
|
+
(a0) => ref.onSuccess(a0),
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
onFailure(cause: Cause<ErrIn>): IO<EnvIn, never, void> {
|
|
52
|
+
return this.use(({ ref, mapErrorInput }) => ref.onFailure(cause.map(mapErrorInput)));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
get get(): IO<EnvOut, ErrOut, Out> {
|
|
56
|
+
return this.use(({ ref, mapGetError, mapGet }) => ref.get.matchIO((e) => IO.failNow(mapGetError(e)), mapGet));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
set(a: In, __tsplusTrace?: string): IO<EnvIn, ErrInRef, void> {
|
|
60
|
+
return this.use(({ ref, mapSet }) => mapSet(a).flatMap((a0) => ref.set(a0)));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
modify<C>(f: (b: Out) => readonly [C, In], __tsplusTrace?: string): IO<EnvIn | EnvOut, ErrOut | ErrInRef, C> {
|
|
64
|
+
return this.modifyIO((out) => IO.succeedNow(f(out)));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
modifyIO<R1, E1, C>(
|
|
68
|
+
f: (b: Out) => IO<R1, E1, readonly [C, In]>,
|
|
69
|
+
__tsplusTrace?: string,
|
|
70
|
+
): IO<EnvIn | EnvOut | R1, ErrOut | ErrInRef | E1, C> {
|
|
71
|
+
return this.use(({ ref, mapGetError, mapSet, mapGet }) =>
|
|
72
|
+
ref.get.mapError(mapGetError).flatMap((a0) =>
|
|
73
|
+
mapGet(a0)
|
|
74
|
+
.flatMap(f)
|
|
75
|
+
.flatMap(([c, a]) =>
|
|
76
|
+
mapSet(a)
|
|
77
|
+
.flatMap((a0) => ref.set(a0))
|
|
78
|
+
.as(c),
|
|
79
|
+
),
|
|
80
|
+
),
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
match<EC, ED, C, D>(
|
|
85
|
+
ea: (_: ErrInRef) => EC,
|
|
86
|
+
eb: (_: ErrOut) => ED,
|
|
87
|
+
ca: (_: C) => Either<EC, In>,
|
|
88
|
+
bd: (_: Out) => Either<ED, D>,
|
|
89
|
+
__tsplusTrace?: string,
|
|
90
|
+
): PRef<EnvIn, EnvOut, EC, ED, C, D> {
|
|
91
|
+
return this.matchIO(ea, eb, ca, bd);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
matchAll<EC, ED, C, D>(
|
|
95
|
+
ea: (_: ErrInRef) => EC,
|
|
96
|
+
eb: (_: ErrOut) => ED,
|
|
97
|
+
ec: (_: ErrOut) => EC,
|
|
98
|
+
ca: (_: C) => (_: Out) => Either<EC, In>,
|
|
99
|
+
bd: (_: Out) => Either<ED, D>,
|
|
100
|
+
__tsplusTrace?: string,
|
|
101
|
+
): PRef<EnvIn | EnvOut, EnvOut, EC, ED, C, D> {
|
|
102
|
+
return this.matchAllIO(ea, eb, ec, ca, bd);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
matchIO<RC, RD, EC, ED, C, D>(
|
|
106
|
+
mapSetError: (_: ErrInRef) => EC,
|
|
107
|
+
mapGetError: (_: ErrOut) => ED,
|
|
108
|
+
mapSet: (_: C) => IO<RC, EC, In>,
|
|
109
|
+
mapGet: (_: Out) => IO<RD, ED, D>,
|
|
110
|
+
__tsplusTrace?: string,
|
|
111
|
+
): PSynchronized<EnvIn | RC, EnvOut | RD, EC, ED, C, D> {
|
|
112
|
+
return this.use(
|
|
113
|
+
({ ref }) =>
|
|
114
|
+
new PSynchronizedInternal(
|
|
115
|
+
ref.semaphore,
|
|
116
|
+
this.get.matchIO((e) => IO.failNow(mapGetError(e)), mapGet),
|
|
117
|
+
(c) => mapSet(c).flatMap((a) => this.set(a).mapError(mapSetError)),
|
|
118
|
+
),
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
matchAllIO<RC, RD, EC, ED, C, D>(
|
|
123
|
+
mapSetError: (_: ErrInRef) => EC,
|
|
124
|
+
mapGetError: (_: ErrOut) => ED,
|
|
125
|
+
mapSetGetError: (_: ErrOut) => EC,
|
|
126
|
+
mapSet: (_: C) => (_: Out) => IO<RC, EC, In>,
|
|
127
|
+
mapGet: (_: Out) => IO<RD, ED, D>,
|
|
128
|
+
__tsplusTrace?: string,
|
|
129
|
+
): PSynchronized<EnvIn | EnvOut | RC, EnvOut | RD, EC, ED, C, D> {
|
|
130
|
+
return this.use(
|
|
131
|
+
({ ref }) =>
|
|
132
|
+
new PSynchronizedInternal(
|
|
133
|
+
ref.semaphore,
|
|
134
|
+
this.get.matchIO((e) => IO.failNow(mapGetError(e)), mapGet),
|
|
135
|
+
(c) =>
|
|
136
|
+
this.get.matchIO(
|
|
137
|
+
(e) => IO.failNow(mapSetGetError(e)),
|
|
138
|
+
(b) => mapSet(c)(b).flatMap((a) => this.set(a).mapError(mapSetError)),
|
|
139
|
+
),
|
|
140
|
+
),
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
matchIOSubject<RC, RD, EI, EC, ED, C, D>(
|
|
145
|
+
mapSetError: (_: ErrInRef) => EC,
|
|
146
|
+
mapGetError: (_: ErrOut) => ED,
|
|
147
|
+
mapErrorInput: (_: EI) => ErrIn,
|
|
148
|
+
mapSetErrorInput: (_: EC) => ErrInRef,
|
|
149
|
+
mapSet: (_: C) => IO<RC, EC, In>,
|
|
150
|
+
mapGet: (_: Out) => IO<RD, ED, D>,
|
|
151
|
+
__tsplusTrace?: string,
|
|
152
|
+
): PRefSubject<EnvIn | RC, EnvOut | RD, EI, ED, EC, C, D> {
|
|
153
|
+
return this.use(
|
|
154
|
+
(r) =>
|
|
155
|
+
new Derived<EnvIn | RC, EnvOut | RD, EI, ED, EC, C, D>((f) =>
|
|
156
|
+
f({
|
|
157
|
+
ref: r.ref,
|
|
158
|
+
mapSetError: (e0) => mapSetError(r.mapSetError(e0)),
|
|
159
|
+
mapGetError: (e0) => mapGetError(r.mapGetError(e0)),
|
|
160
|
+
mapErrorInput: (ei) => r.mapErrorInput(mapErrorInput(ei)),
|
|
161
|
+
mapSetErrorInput: (ec) => r.mapSetErrorInput(mapSetErrorInput(ec)),
|
|
162
|
+
mapSet: (c) => mapSet(c).flatMap((inp) => r.mapSet(inp).mapError(mapSetError)),
|
|
163
|
+
mapGet: (a0) => r.mapGet(a0).mapError(mapGetError).flatMap(mapGet),
|
|
164
|
+
}),
|
|
165
|
+
),
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
run<R1>(sink: UnsafeSink<R1, ErrOut, Out>): IO<Scope | EnvOut | R1, never, void> {
|
|
170
|
+
return this.use(({ ref, mapGet, mapGetError }) =>
|
|
171
|
+
ref.run(
|
|
172
|
+
Sink.unsafeMake(
|
|
173
|
+
(a0) => mapGet(a0).matchCauseIO(sink.onFailure, sink.onSuccess),
|
|
174
|
+
(cause) => sink.onFailure(cause.map(mapGetError)),
|
|
175
|
+
),
|
|
176
|
+
),
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
MappableRef,
|
|
3
|
+
MappableSynchronized,
|
|
4
|
+
ModifiableRef,
|
|
5
|
+
ModifiableSynchronized,
|
|
6
|
+
PSynchronized,
|
|
7
|
+
ReadableRef,
|
|
8
|
+
WritableRef,
|
|
9
|
+
} from "../../Ref.js";
|
|
10
|
+
import type { IO } from "@fncts/io/IO";
|
|
11
|
+
|
|
12
|
+
import { RefTypeId, RefVariance, SynchronizedTypeId } from "../../Ref.js";
|
|
13
|
+
import { PSubject } from "../definition.js";
|
|
14
|
+
|
|
15
|
+
export abstract class PRefSubject<EnvIn, EnvOut, ErrIn, ErrOut, ErrInRef, In, Out>
|
|
16
|
+
extends PSubject<EnvIn, EnvOut, ErrIn, ErrOut, In, Out>
|
|
17
|
+
implements
|
|
18
|
+
PRef<EnvIn, EnvOut, ErrInRef, ErrOut, In, Out>,
|
|
19
|
+
PSynchronized<EnvIn, EnvOut, ErrInRef, ErrOut, In, Out>,
|
|
20
|
+
ReadableRef<EnvOut, ErrOut, Out>,
|
|
21
|
+
WritableRef<EnvIn, ErrInRef, In>,
|
|
22
|
+
ModifiableRef<EnvIn, EnvOut, ErrInRef, ErrOut, In, Out>,
|
|
23
|
+
MappableRef<EnvIn, EnvOut, ErrInRef, ErrOut, In, Out>,
|
|
24
|
+
ModifiableSynchronized<EnvIn, EnvOut, ErrInRef, ErrOut, In, Out>,
|
|
25
|
+
MappableSynchronized<EnvIn, EnvOut, ErrInRef, ErrOut, In, Out>
|
|
26
|
+
{
|
|
27
|
+
readonly [SynchronizedTypeId]: SynchronizedTypeId = SynchronizedTypeId;
|
|
28
|
+
readonly [RefTypeId]: RefTypeId = RefTypeId;
|
|
29
|
+
declare [RefVariance]: {
|
|
30
|
+
readonly _RA: (_: never) => EnvIn;
|
|
31
|
+
readonly _RB: (_: never) => EnvOut;
|
|
32
|
+
readonly _EA: (_: never) => ErrInRef;
|
|
33
|
+
readonly _EB: (_: never) => ErrOut;
|
|
34
|
+
readonly _A: (_: In) => void;
|
|
35
|
+
readonly _B: (_: never) => Out;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
abstract get: IO<EnvOut, ErrOut, Out>;
|
|
39
|
+
|
|
40
|
+
abstract set(a: In, __tsplusTrace?: string): IO<EnvIn, ErrInRef, void>;
|
|
41
|
+
|
|
42
|
+
abstract modify<C>(f: (b: Out) => readonly [C, In], __tsplusTrace?: string): IO<EnvIn | EnvOut, ErrOut | ErrInRef, C>;
|
|
43
|
+
|
|
44
|
+
abstract modifyIO<R1, E1, C>(
|
|
45
|
+
f: (b: Out) => IO<R1, E1, readonly [C, In]>,
|
|
46
|
+
__tsplusTrace?: string,
|
|
47
|
+
): IO<EnvIn | EnvOut | R1, ErrOut | ErrInRef | E1, C>;
|
|
48
|
+
|
|
49
|
+
abstract match<EC, ED, C, D>(
|
|
50
|
+
ea: (_: ErrInRef) => EC,
|
|
51
|
+
eb: (_: ErrOut) => ED,
|
|
52
|
+
ca: (_: C) => Either<EC, In>,
|
|
53
|
+
bd: (_: Out) => Either<ED, D>,
|
|
54
|
+
): PRef<EnvIn, EnvOut, EC, ED, C, D>;
|
|
55
|
+
|
|
56
|
+
abstract matchAll<EC, ED, C, D>(
|
|
57
|
+
ea: (_: ErrInRef) => EC,
|
|
58
|
+
eb: (_: ErrOut) => ED,
|
|
59
|
+
ec: (_: ErrOut) => EC,
|
|
60
|
+
ca: (_: C) => (_: Out) => Either<EC, In>,
|
|
61
|
+
bd: (_: Out) => Either<ED, D>,
|
|
62
|
+
): PRef<EnvIn | EnvOut, EnvOut, EC, ED, C, D>;
|
|
63
|
+
|
|
64
|
+
abstract matchIO<RC, RD, EC, ED, C, D>(
|
|
65
|
+
mapSetError: (_: ErrInRef) => EC,
|
|
66
|
+
mapGetError: (_: ErrOut) => ED,
|
|
67
|
+
mapSet: (_: C) => IO<RC, EC, In>,
|
|
68
|
+
mapGet: (_: Out) => IO<RD, ED, D>,
|
|
69
|
+
__tsplusTrace?: string,
|
|
70
|
+
): PSynchronized<EnvIn | RC, EnvOut | RD, EC, ED, C, D>;
|
|
71
|
+
|
|
72
|
+
abstract matchAllIO<RC, RD, EC, ED, C, D>(
|
|
73
|
+
mapSetError: (_: ErrInRef) => EC,
|
|
74
|
+
mapGetError: (_: ErrOut) => ED,
|
|
75
|
+
mapSetGetError: (_: ErrOut) => EC,
|
|
76
|
+
mapSet: (_: C) => (_: Out) => IO<RC, EC, In>,
|
|
77
|
+
mapGet: (_: Out) => IO<RD, ED, D>,
|
|
78
|
+
__tsplusTrace?: string,
|
|
79
|
+
): PSynchronized<EnvIn | EnvOut | RC, EnvOut | RD, EC, ED, C, D>;
|
|
80
|
+
|
|
81
|
+
abstract matchIOSubject<RC, RD, EI, EC, ED, C, D>(
|
|
82
|
+
mapSetError: (_: ErrInRef) => EC,
|
|
83
|
+
mapGetError: (_: ErrOut) => ED,
|
|
84
|
+
mapErrorInput: (_: EI) => ErrIn,
|
|
85
|
+
mapSetErrorInput: (_: EC) => ErrInRef,
|
|
86
|
+
mapSet: (_: C) => IO<RC, EC, In>,
|
|
87
|
+
mapGet: (_: Out) => IO<RD, ED, D>,
|
|
88
|
+
__tsplusTrace?: string,
|
|
89
|
+
): PRefSubject<EnvIn | RC, EnvOut | RD, EI, ED, EC, C, D>;
|
|
90
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UnsafeSink } from "../Push/Sink.js";
|
|
2
|
+
import type { Cause } from "@fncts/base/data/Cause";
|
|
3
|
+
import type { IO } from "@fncts/io/IO";
|
|
4
|
+
|
|
5
|
+
import { Push, PushTypeId } from "../Push.js";
|
|
2
6
|
|
|
3
7
|
export const SubjectTypeId = Symbol.for("fncts.io.Push.Subject");
|
|
4
8
|
export type SubjectTypeId = typeof SubjectTypeId;
|
|
@@ -6,10 +10,24 @@ export type SubjectTypeId = typeof SubjectTypeId;
|
|
|
6
10
|
/**
|
|
7
11
|
* @tsplus type fncts.io.Push.Subject
|
|
8
12
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
13
|
+
export abstract class PSubject<out EnvIn, out EnvOut, in ErrIn, out ErrOut, in In, Out>
|
|
14
|
+
extends Push<EnvOut | Scope, ErrOut, Out>
|
|
15
|
+
implements Push<EnvOut | Scope, ErrOut, Out>, UnsafeSink<EnvIn, ErrIn, In>
|
|
16
|
+
{
|
|
17
|
+
readonly _pushOpCode = null;
|
|
18
|
+
readonly [PushTypeId]: PushTypeId = PushTypeId;
|
|
19
|
+
readonly [SubjectTypeId]: SubjectTypeId = SubjectTypeId;
|
|
20
|
+
|
|
21
|
+
abstract onSuccess(value: In): IO<EnvIn, never, void>;
|
|
22
|
+
abstract onFailure(cause: Cause<ErrIn>): IO<EnvIn, never, void>;
|
|
23
|
+
|
|
24
|
+
abstract interrupt: URIO<EnvIn, void>;
|
|
25
|
+
|
|
26
|
+
abstract subscribers: number;
|
|
11
27
|
}
|
|
12
28
|
|
|
29
|
+
export type Subject<R, E, A> = PSubject<R, R, E, E, A, A>;
|
|
30
|
+
|
|
13
31
|
/**
|
|
14
32
|
* @tsplus type fncts.io.Push.SubjectOps
|
|
15
33
|
*/
|