@fncts/io 0.0.45 → 0.0.46
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.d.ts +2 -2
- package/Channel/ChildExecutorDecision.d.ts +1 -1
- package/Channel/UpstreamPullRequest.d.ts +1 -1
- package/Channel.d.ts +2 -2
- package/Clock.d.ts +2 -2
- package/Console.d.ts +2 -2
- package/Fiber.d.ts +19 -19
- package/FiberRef.d.ts +5 -5
- package/FiberRefs.d.ts +1 -1
- package/FiberScope.d.ts +1 -1
- package/FiberStatus.d.ts +1 -1
- package/Future/api.d.ts +6 -0
- package/Future.d.ts +2 -2
- package/Hub.d.ts +1 -1
- package/IO/runtime.d.ts +3 -3
- package/IO.d.ts +63 -63
- package/IOEnv.d.ts +2 -2
- package/InterruptStatus.d.ts +1 -1
- package/Layer.d.ts +1 -1
- package/Logger.d.ts +2 -2
- package/MVar.d.ts +1 -1
- package/Push.d.ts +2 -2
- package/Queue/api.d.ts +7 -7
- package/Queue.d.ts +4 -4
- package/Random.d.ts +2 -2
- package/Ref/Synchronized.d.ts +2 -2
- package/Ref/api.d.ts +7 -7
- package/Ref.d.ts +7 -7
- package/RefSubject.d.ts +1 -1
- package/Reloadable.d.ts +2 -2
- package/RuntimeFlags.d.ts +1 -1
- package/STM.d.ts +4 -4
- package/Schedule.d.ts +2 -2
- package/Scope/ReleaseMap.d.ts +2 -2
- package/Scope.d.ts +1 -1
- package/ScopedRef.d.ts +1 -1
- package/Semaphore.d.ts +18 -8
- package/Sink.d.ts +1 -1
- package/State.d.ts +1 -1
- package/Stream.d.ts +1 -1
- package/Subject.d.ts +1 -1
- package/Supervisor.d.ts +2 -2
- package/TExit.d.ts +1 -1
- package/TFuture.d.ts +2 -2
- package/TReentrantLock.d.ts +1 -1
- package/TRef.d.ts +2 -2
- package/TSemaphore.d.ts +2 -2
- package/_cjs/Cached/api.cjs +9 -9
- package/_cjs/Cached/internal.cjs +1 -1
- package/_cjs/Cached.cjs +8 -8
- package/_cjs/Cached.cjs.map +1 -1
- package/_cjs/Channel/ChildExecutorDecision.cjs +8 -8
- package/_cjs/Channel/ChildExecutorDecision.cjs.map +1 -1
- package/_cjs/Channel/UpstreamPullRequest.cjs +8 -8
- package/_cjs/Channel/UpstreamPullRequest.cjs.map +1 -1
- package/_cjs/Channel/api/interruptWhen.cjs +5 -5
- package/_cjs/Channel/api/mapOutConcurrentIO.cjs +19 -19
- package/_cjs/Channel/api/mergeAll.cjs +1 -1
- package/_cjs/Channel/api/mergeAllUnboundedWith.cjs +1 -1
- package/_cjs/Channel/api/mergeAllWith.cjs +26 -26
- package/_cjs/Channel/api/mergeMap.cjs +2 -2
- package/_cjs/Channel/api/mergeWith.cjs +14 -14
- package/_cjs/Channel/api/run.cjs +2 -2
- package/_cjs/Channel/api/runCollect.cjs +2 -2
- package/_cjs/Channel/api/runDrain.cjs +2 -2
- package/_cjs/Channel/api/runScoped.cjs +10 -10
- package/_cjs/Channel/api/toPull.cjs +4 -4
- package/_cjs/Channel/api/zipConcurrent.cjs +5 -5
- package/_cjs/Channel/api.cjs +26 -26
- package/_cjs/Channel/internal/ChannelExecutor.cjs +25 -25
- package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
- package/_cjs/Channel/internal/ChannelState.cjs +1 -1
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +13 -13
- package/_cjs/Channel.cjs +8 -8
- package/_cjs/Channel.cjs.map +1 -1
- package/_cjs/Clock/api.cjs +1 -1
- package/_cjs/Clock/definition.cjs +1 -1
- package/_cjs/Clock/live.cjs +4 -4
- package/_cjs/Clock.cjs +8 -8
- package/_cjs/Clock.cjs.map +1 -1
- package/_cjs/Console/api.cjs +1 -1
- package/_cjs/Console/definition.cjs +1 -1
- package/_cjs/Console/live.cjs +1 -1
- package/_cjs/Console.cjs +8 -8
- package/_cjs/Console.cjs.map +1 -1
- package/_cjs/CountdownLatch.cjs +6 -6
- package/_cjs/Differ/api.cjs +3 -3
- package/_cjs/Fiber/FiberRuntime.cjs +30 -30
- package/_cjs/Fiber/api/awaitAll.cjs +3 -3
- package/_cjs/Fiber/api/collectAll.cjs +18 -18
- package/_cjs/Fiber/api/fromIO.cjs +2 -2
- package/_cjs/Fiber/api/interrupt.cjs +2 -2
- package/_cjs/Fiber/api/interruptAll.cjs +3 -3
- package/_cjs/Fiber/api/interruptAs.cjs +2 -2
- package/_cjs/Fiber/api/interruptFork.cjs +2 -2
- package/_cjs/Fiber/api/join.cjs +2 -2
- package/_cjs/Fiber/api/joinAll.cjs +3 -3
- package/_cjs/Fiber/api/mapFiber.cjs +4 -4
- package/_cjs/Fiber/api/mapIO.cjs +10 -10
- package/_cjs/Fiber/api/zipWith.cjs +12 -12
- package/_cjs/Fiber/constructors.cjs +5 -5
- package/_cjs/Fiber/definition.cjs +1 -1
- package/_cjs/Fiber.cjs +83 -83
- package/_cjs/Fiber.cjs.map +1 -1
- package/_cjs/FiberRef/api/locallyScoped.cjs +3 -3
- package/_cjs/FiberRef/api/locallyScopedWith.cjs +2 -2
- package/_cjs/FiberRef/constructors.cjs +4 -4
- package/_cjs/FiberRef/definition.cjs +4 -4
- package/_cjs/FiberRef/operations.cjs +3 -3
- package/_cjs/FiberRef/unsafe.cjs +16 -16
- package/_cjs/FiberRef/unsafe.cjs.map +1 -1
- package/_cjs/FiberRef.cjs +24 -24
- package/_cjs/FiberRef.cjs.map +1 -1
- package/_cjs/FiberRefs/Patch.cjs +6 -6
- package/_cjs/FiberRefs/api.cjs +8 -8
- package/_cjs/FiberRefs/definition.cjs +1 -1
- package/_cjs/FiberRefs.cjs +8 -8
- package/_cjs/FiberRefs.cjs.map +1 -1
- package/_cjs/FiberScope/definition.cjs +5 -5
- package/_cjs/FiberScope.cjs +8 -8
- package/_cjs/FiberScope.cjs.map +1 -1
- package/_cjs/FiberSet.cjs +9 -9
- package/_cjs/FiberStatus/definition.cjs +1 -1
- package/_cjs/FiberStatus.cjs +8 -8
- package/_cjs/FiberStatus.cjs.map +1 -1
- package/_cjs/Future/api.cjs +18 -9
- package/_cjs/Future/api.cjs.map +1 -1
- package/_cjs/Future/constructors.cjs +2 -2
- package/_cjs/Future.cjs +8 -8
- package/_cjs/Future.cjs.map +1 -1
- package/_cjs/Hub/api.cjs +10 -10
- package/_cjs/Hub/internal.cjs +15 -15
- package/_cjs/Hub.cjs +8 -8
- package/_cjs/Hub.cjs.map +1 -1
- package/_cjs/IO/api/acquireRelease.cjs +1 -1
- package/_cjs/IO/api/acquireReleaseExit.cjs +3 -3
- package/_cjs/IO/api/acquireReleaseInterruptible.cjs +1 -1
- package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs +3 -3
- package/_cjs/IO/api/addFinalizer.cjs +1 -1
- package/_cjs/IO/api/addFinalizerExit.cjs +4 -4
- package/_cjs/IO/api/all.cjs +4 -4
- package/_cjs/IO/api/asyncIO.cjs +7 -7
- package/_cjs/IO/api/asyncInterrupt.cjs +6 -6
- package/_cjs/IO/api/blocking.cjs +3 -3
- package/_cjs/IO/api/bracket.cjs +1 -1
- package/_cjs/IO/api/bracketExit.cjs +4 -4
- package/_cjs/IO/api/clockWith.cjs +5 -5
- package/_cjs/IO/api/concurrency.cjs +6 -6
- package/_cjs/IO/api/concurrency.cjs.map +1 -1
- package/_cjs/IO/api/concurrentFinalizers.cjs +8 -8
- package/_cjs/IO/api/consoleWith.cjs +5 -5
- package/_cjs/IO/api/daemonChildren.cjs +4 -4
- package/_cjs/IO/api/delay.cjs +2 -2
- package/_cjs/IO/api/descriptor.cjs +4 -4
- package/_cjs/IO/api/diffFiberRefs.cjs +2 -2
- package/_cjs/IO/api/disconnect.cjs +4 -4
- package/_cjs/IO/api/ensuringChildren.cjs +4 -4
- package/_cjs/IO/api/environment.cjs +4 -4
- package/_cjs/IO/api/foreachConcurrent.cjs +21 -21
- package/_cjs/IO/api/foreachExec.cjs +4 -4
- package/_cjs/IO/api/fork.cjs +7 -7
- package/_cjs/IO/api/forkAll.cjs +3 -3
- package/_cjs/IO/api/forkDaemon.cjs +2 -2
- package/_cjs/IO/api/forkIn.cjs +5 -5
- package/_cjs/IO/api/forkScoped.cjs +5 -5
- package/_cjs/IO/api/fulfill.cjs +3 -3
- package/_cjs/IO/api/interrupt.cjs +6 -6
- package/_cjs/IO/api/memoize.cjs +7 -7
- package/_cjs/IO/api/onTermination.cjs +4 -4
- package/_cjs/IO/api/once.cjs +3 -3
- package/_cjs/IO/api/patchFiberRefs.cjs +2 -2
- package/_cjs/IO/api/provideLayer.cjs +5 -5
- package/_cjs/IO/api/provideScope.cjs +2 -2
- package/_cjs/IO/api/provideSomeLayer.cjs +2 -2
- package/_cjs/IO/api/provideSomeRuntime.cjs +6 -6
- package/_cjs/IO/api/race.cjs +8 -8
- package/_cjs/IO/api/raceFirst.cjs +2 -2
- package/_cjs/IO/api/raceWith.cjs +3 -3
- package/_cjs/IO/api/randomWith.cjs +5 -5
- package/_cjs/IO/api/repeat.cjs +5 -5
- package/_cjs/IO/api/retry.cjs +4 -4
- package/_cjs/IO/api/schedule.cjs +2 -2
- package/_cjs/IO/api/scope.cjs +2 -2
- package/_cjs/IO/api/scopeWith.cjs +2 -2
- package/_cjs/IO/api/scoped.cjs +2 -2
- package/_cjs/IO/api/sequenceT.cjs +1 -1
- package/_cjs/IO/api/sleep.cjs +1 -1
- package/_cjs/IO/api/stateful.cjs +3 -3
- package/_cjs/IO/api/supervised.cjs +3 -3
- package/_cjs/IO/api/timeout.cjs +8 -8
- package/_cjs/IO/api/transplant.cjs +5 -5
- package/_cjs/IO/api/whenFiberRef.cjs +2 -2
- package/_cjs/IO/api/whenRef.cjs +2 -2
- package/_cjs/IO/api/withChildren.cjs +4 -4
- package/_cjs/IO/api/withEarlyRelease.cjs +4 -4
- package/_cjs/IO/api/withFinalizer.cjs +1 -1
- package/_cjs/IO/api/withFinalizerExit.cjs +1 -1
- package/_cjs/IO/api/zipConcurrent.cjs +13 -13
- package/_cjs/IO/api.cjs +24 -24
- package/_cjs/IO/api.cjs.map +1 -1
- package/_cjs/IO/definition.cjs +1 -1
- package/_cjs/IO/runtime.cjs +15 -15
- package/_cjs/IO.cjs +256 -256
- package/_cjs/IO.cjs.map +1 -1
- package/_cjs/IOEnv/definition.cjs +8 -8
- package/_cjs/IOEnv/definition.cjs.map +1 -1
- package/_cjs/IOEnv/live.cjs +8 -8
- package/_cjs/IOEnv/live.cjs.map +1 -1
- package/_cjs/IOEnv/services.cjs +1 -1
- package/_cjs/IOEnv.cjs +8 -8
- package/_cjs/IOEnv.cjs.map +1 -1
- package/_cjs/InterruptStatus.cjs +8 -8
- package/_cjs/InterruptStatus.cjs.map +1 -1
- package/_cjs/Layer/MemoMap.cjs +21 -21
- package/_cjs/Layer/api.cjs +14 -14
- package/_cjs/Layer.cjs +8 -8
- package/_cjs/Layer.cjs.map +1 -1
- package/_cjs/Logger/api.cjs +2 -2
- package/_cjs/Logger/constructors.cjs +5 -5
- package/_cjs/Logger.cjs +8 -8
- package/_cjs/Logger.cjs.map +1 -1
- package/_cjs/MVar/api.cjs +11 -11
- package/_cjs/MVar.cjs +8 -8
- package/_cjs/MVar.cjs.map +1 -1
- package/_cjs/Push/api.cjs +33 -33
- package/_cjs/Push/internal.cjs +18 -19
- package/_cjs/Push/internal.cjs.map +1 -1
- package/_cjs/Push.cjs +8 -8
- package/_cjs/Push.cjs.map +1 -1
- package/_cjs/Queue/api/dimapIO.cjs +1 -1
- package/_cjs/Queue/api/filterInputIO.cjs +3 -3
- package/_cjs/Queue/api/filterOutputIO.cjs +3 -3
- package/_cjs/Queue/api/poll.cjs +2 -2
- package/_cjs/Queue/api/takeBetween.cjs +3 -3
- package/_cjs/Queue/api/takeN.cjs +1 -1
- package/_cjs/Queue/api/zipWithIO.cjs +4 -4
- package/_cjs/Queue/api.cjs +32 -32
- package/_cjs/Queue/api.cjs.map +1 -1
- package/_cjs/Queue/constructors.cjs +1 -1
- package/_cjs/Queue/internal.cjs +9 -9
- package/_cjs/Queue/strategy.cjs +6 -6
- package/_cjs/Queue.cjs +16 -16
- package/_cjs/Queue.cjs.map +1 -1
- package/_cjs/Random/api.cjs +1 -1
- package/_cjs/Random/definition.cjs +1 -1
- package/_cjs/Random/live.cjs +2 -2
- package/_cjs/Random/live.cjs.map +1 -1
- package/_cjs/Random.cjs +8 -8
- package/_cjs/Random.cjs.map +1 -1
- package/_cjs/Ref/Atomic.cjs +1 -1
- package/_cjs/Ref/Derived.cjs +4 -4
- package/_cjs/Ref/DerivedAll.cjs +4 -4
- package/_cjs/Ref/Synchronized/api.cjs +3 -3
- package/_cjs/Ref/Synchronized/constructors.cjs +5 -5
- package/_cjs/Ref/Synchronized/definition.cjs +1 -1
- package/_cjs/Ref/Synchronized.cjs +8 -8
- package/_cjs/Ref/Synchronized.cjs.map +1 -1
- package/_cjs/Ref/api/collect.cjs +3 -3
- package/_cjs/Ref/api/dimap.cjs +2 -2
- package/_cjs/Ref/api/filter.cjs +3 -3
- package/_cjs/Ref/api/modify.cjs +1 -1
- package/_cjs/Ref/api.cjs +35 -36
- package/_cjs/Ref/api.cjs.map +1 -1
- package/_cjs/Ref/constructors.cjs +1 -1
- package/_cjs/Ref.cjs +35 -35
- package/_cjs/Ref.cjs.map +1 -1
- package/_cjs/RefSubject/Atomic.cjs +5 -5
- package/_cjs/RefSubject/Synchronized/api.cjs +4 -4
- package/_cjs/RefSubject/Synchronized/definition.cjs +2 -2
- package/_cjs/RefSubject/api.cjs +4 -4
- package/_cjs/RefSubject.cjs +11 -11
- package/_cjs/RefSubject.cjs.map +1 -1
- package/_cjs/Reloadable/api.cjs +4 -4
- package/_cjs/Reloadable/api.cjs.map +1 -1
- package/_cjs/Reloadable/constructors.cjs +10 -10
- package/_cjs/Reloadable/definition.cjs +3 -3
- package/_cjs/Reloadable.cjs +8 -8
- package/_cjs/Reloadable.cjs.map +1 -1
- package/_cjs/RuntimeFlags/Patch.cjs +1 -1
- package/_cjs/RuntimeFlags/RuntimeFlags.cjs +1 -1
- package/_cjs/RuntimeFlags.cjs +8 -8
- package/_cjs/RuntimeFlags.cjs.map +1 -1
- package/_cjs/STM/api/atomically.cjs +7 -7
- package/_cjs/STM/api/core-api.cjs +3 -3
- package/_cjs/STM/api.cjs +10 -10
- package/_cjs/STM/definition.cjs +1 -1
- package/_cjs/STM/driver.cjs +5 -5
- package/_cjs/STM/internal/CommitState.cjs +1 -1
- package/_cjs/STM/internal/Journal.cjs +4 -4
- package/_cjs/STM.cjs +16 -16
- package/_cjs/STM.cjs.map +1 -1
- package/_cjs/Schedule/Decision.cjs +2 -2
- package/_cjs/Schedule/api/driver.cjs +12 -12
- package/_cjs/Schedule/api.cjs +20 -20
- package/_cjs/Schedule/api.cjs.map +1 -1
- package/_cjs/Schedule.cjs +16 -16
- package/_cjs/Schedule.cjs.map +1 -1
- package/_cjs/Scope/Finalizer/definition.cjs +2 -2
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +8 -8
- package/_cjs/Scope/ReleaseMap/api.cjs +6 -6
- package/_cjs/Scope/ReleaseMap/constructors.cjs +3 -3
- package/_cjs/Scope/ReleaseMap/definition.cjs +1 -1
- package/_cjs/Scope/ReleaseMap.cjs +8 -8
- package/_cjs/Scope/ReleaseMap.cjs.map +1 -1
- package/_cjs/Scope/api.cjs +10 -10
- package/_cjs/Scope/definition.cjs +2 -2
- package/_cjs/Scope.cjs +8 -8
- package/_cjs/Scope.cjs.map +1 -1
- package/_cjs/ScopedRef/api.cjs +12 -12
- package/_cjs/ScopedRef.cjs +8 -8
- package/_cjs/ScopedRef.cjs.map +1 -1
- package/_cjs/Semaphore.cjs +101 -44
- package/_cjs/Semaphore.cjs.map +1 -1
- package/_cjs/Sink/api.cjs +34 -34
- package/_cjs/Sink/api.cjs.map +1 -1
- package/_cjs/Sink.cjs +8 -8
- package/_cjs/Sink.cjs.map +1 -1
- package/_cjs/State/api.cjs +4 -4
- package/_cjs/State.cjs +8 -8
- package/_cjs/State.cjs.map +1 -1
- package/_cjs/Stream/api/zipAllWith.cjs +8 -8
- package/_cjs/Stream/api/zipWith.cjs +1 -1
- package/_cjs/Stream/api/zipWithChunks.cjs +6 -6
- package/_cjs/Stream/api.cjs +70 -70
- package/_cjs/Stream/api.cjs.map +1 -1
- package/_cjs/Stream/internal/Handoff.cjs +6 -6
- package/_cjs/Stream/internal/Pull.cjs +7 -7
- package/_cjs/Stream/internal/Pull.cjs.map +1 -1
- package/_cjs/Stream/internal/Take.cjs +11 -11
- package/_cjs/Stream/internal/Take.cjs.map +1 -1
- package/_cjs/Stream/internal/util.cjs +3 -3
- package/_cjs/Stream.cjs +8 -8
- package/_cjs/Stream.cjs.map +1 -1
- package/_cjs/Subject/Atomic.cjs +1 -1
- package/_cjs/Subject/api.cjs +1 -1
- package/_cjs/Subject.cjs +11 -11
- package/_cjs/Subject.cjs.map +1 -1
- package/_cjs/SubscriptionRef.cjs +7 -7
- package/_cjs/Supervisor/api.cjs +2 -2
- package/_cjs/Supervisor/constructors.cjs +8 -6
- package/_cjs/Supervisor/constructors.cjs.map +1 -1
- package/_cjs/Supervisor/definition.cjs +1 -1
- package/_cjs/Supervisor.cjs +8 -8
- package/_cjs/Supervisor.cjs.map +1 -1
- package/_cjs/SupervisorPatch.cjs +4 -4
- package/_cjs/TExit/definition.cjs +6 -6
- package/_cjs/TExit/definition.cjs.map +1 -1
- package/_cjs/TExit.cjs +8 -8
- package/_cjs/TExit.cjs.map +1 -1
- package/_cjs/TFuture/api.cjs +9 -9
- package/_cjs/TFuture/constructors.cjs +5 -5
- package/_cjs/TFuture/definition.cjs +1 -1
- package/_cjs/TFuture.cjs +8 -8
- package/_cjs/TFuture.cjs.map +1 -1
- package/_cjs/TReentrantLock/api.cjs +12 -12
- package/_cjs/TReentrantLock/api.cjs.map +1 -1
- package/_cjs/TReentrantLock/definition.cjs +5 -5
- package/_cjs/TReentrantLock.cjs +8 -8
- package/_cjs/TReentrantLock.cjs.map +1 -1
- package/_cjs/TRef/api.cjs +2 -2
- package/_cjs/TRef/constructors.cjs +3 -3
- package/_cjs/TRef/definition.cjs +7 -7
- package/_cjs/TRef.cjs +8 -8
- package/_cjs/TRef.cjs.map +1 -1
- package/_cjs/TSemaphore/api.cjs +5 -5
- package/_cjs/TSemaphore/constructors.cjs +4 -4
- package/_cjs/TSemaphore/definition.cjs +1 -1
- package/_cjs/TSemaphore.cjs +8 -8
- package/_cjs/TSemaphore.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +3 -3
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +3 -3
- package/_cjs/collection/immutable/Conc/filterIO.cjs +1 -1
- package/_cjs/collection/immutable/Conc/findIO.cjs +2 -2
- package/_cjs/collection/immutable/Conc/mapIO.cjs +1 -1
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +3 -3
- package/_cjs/collection/immutable/Conc.cjs +24 -24
- package/_cjs/collection/immutable/Conc.cjs.map +1 -1
- package/_cjs/data/Exit/foreachIO.cjs +3 -3
- package/_cjs/internal/HashedPair.cjs +4 -4
- package/_cjs/internal/Hub.cjs +4 -4
- package/_cjs/internal/MutableQueue.cjs +2 -2
- package/_cjs/internal/Scheduler.cjs +1 -1
- package/_cjs/internal/StackTraceBuilder.cjs +2 -2
- package/_mjs/Cached.mjs +2 -3
- package/_mjs/Cached.mjs.map +1 -1
- package/_mjs/Channel/ChildExecutorDecision.mjs +1 -2
- package/_mjs/Channel/ChildExecutorDecision.mjs.map +1 -1
- package/_mjs/Channel/UpstreamPullRequest.mjs +1 -2
- package/_mjs/Channel/UpstreamPullRequest.mjs.map +1 -1
- package/_mjs/Channel.mjs +2 -3
- package/_mjs/Channel.mjs.map +1 -1
- package/_mjs/Clock.mjs +2 -3
- package/_mjs/Clock.mjs.map +1 -1
- package/_mjs/Console.mjs +2 -3
- package/_mjs/Console.mjs.map +1 -1
- package/_mjs/Fiber.mjs +19 -21
- package/_mjs/Fiber.mjs.map +1 -1
- package/_mjs/FiberRef/unsafe.mjs +5 -5
- package/_mjs/FiberRef/unsafe.mjs.map +1 -1
- package/_mjs/FiberRef.mjs +5 -7
- package/_mjs/FiberRef.mjs.map +1 -1
- package/_mjs/FiberRefs.mjs +1 -2
- package/_mjs/FiberRefs.mjs.map +1 -1
- package/_mjs/FiberScope.mjs +1 -2
- package/_mjs/FiberScope.mjs.map +1 -1
- package/_mjs/FiberStatus.mjs +1 -2
- package/_mjs/FiberStatus.mjs.map +1 -1
- package/_mjs/Future/api.mjs +10 -1
- package/_mjs/Future/api.mjs.map +1 -1
- package/_mjs/Future.mjs +2 -3
- package/_mjs/Future.mjs.map +1 -1
- package/_mjs/Hub.mjs +1 -2
- package/_mjs/Hub.mjs.map +1 -1
- package/_mjs/IO/api/concurrency.mjs +1 -1
- package/_mjs/IO/api/concurrency.mjs.map +1 -1
- package/_mjs/IO/api.mjs +1 -1
- package/_mjs/IO/api.mjs.map +1 -1
- package/_mjs/IO.mjs +63 -65
- package/_mjs/IO.mjs.map +1 -1
- package/_mjs/IOEnv/definition.mjs +1 -1
- package/_mjs/IOEnv/definition.mjs.map +1 -1
- package/_mjs/IOEnv/live.mjs +1 -1
- package/_mjs/IOEnv/live.mjs.map +1 -1
- package/_mjs/IOEnv.mjs +2 -3
- package/_mjs/IOEnv.mjs.map +1 -1
- package/_mjs/InterruptStatus.mjs +1 -2
- package/_mjs/InterruptStatus.mjs.map +1 -1
- package/_mjs/Layer.mjs +1 -2
- package/_mjs/Layer.mjs.map +1 -1
- package/_mjs/Logger.mjs +2 -3
- package/_mjs/Logger.mjs.map +1 -1
- package/_mjs/MVar.mjs +1 -2
- package/_mjs/MVar.mjs.map +1 -1
- package/_mjs/Push/internal.mjs +5 -6
- package/_mjs/Push/internal.mjs.map +1 -1
- package/_mjs/Push.mjs +2 -3
- package/_mjs/Push.mjs.map +1 -1
- package/_mjs/Queue/api.mjs +7 -8
- package/_mjs/Queue/api.mjs.map +1 -1
- package/_mjs/Queue.mjs +4 -5
- package/_mjs/Queue.mjs.map +1 -1
- package/_mjs/Random/live.mjs +1 -1
- package/_mjs/Random/live.mjs.map +1 -1
- package/_mjs/Random.mjs +2 -3
- package/_mjs/Random.mjs.map +1 -1
- package/_mjs/Ref/Synchronized.mjs +2 -3
- package/_mjs/Ref/Synchronized.mjs.map +1 -1
- package/_mjs/Ref/api.mjs +8 -9
- package/_mjs/Ref/api.mjs.map +1 -1
- package/_mjs/Ref.mjs +7 -9
- package/_mjs/Ref.mjs.map +1 -1
- package/_mjs/RefSubject.mjs +1 -2
- package/_mjs/RefSubject.mjs.map +1 -1
- package/_mjs/Reloadable/api.mjs +3 -3
- package/_mjs/Reloadable/api.mjs.map +1 -1
- package/_mjs/Reloadable.mjs +2 -3
- package/_mjs/Reloadable.mjs.map +1 -1
- package/_mjs/RuntimeFlags.mjs +1 -2
- package/_mjs/RuntimeFlags.mjs.map +1 -1
- package/_mjs/STM.mjs +4 -6
- package/_mjs/STM.mjs.map +1 -1
- package/_mjs/Schedule/api.mjs +2 -2
- package/_mjs/Schedule/api.mjs.map +1 -1
- package/_mjs/Schedule.mjs +2 -3
- package/_mjs/Schedule.mjs.map +1 -1
- package/_mjs/Scope/ReleaseMap.mjs +2 -3
- package/_mjs/Scope/ReleaseMap.mjs.map +1 -1
- package/_mjs/Scope.mjs +1 -2
- package/_mjs/Scope.mjs.map +1 -1
- package/_mjs/ScopedRef.mjs +1 -2
- package/_mjs/ScopedRef.mjs.map +1 -1
- package/_mjs/Semaphore.mjs +98 -42
- package/_mjs/Semaphore.mjs.map +1 -1
- package/_mjs/Sink/api.mjs +1 -1
- package/_mjs/Sink/api.mjs.map +1 -1
- package/_mjs/Sink.mjs +1 -2
- package/_mjs/Sink.mjs.map +1 -1
- package/_mjs/State.mjs +1 -2
- package/_mjs/State.mjs.map +1 -1
- package/_mjs/Stream/api.mjs +1 -1
- package/_mjs/Stream/api.mjs.map +1 -1
- package/_mjs/Stream/internal/Pull.mjs +1 -1
- package/_mjs/Stream/internal/Pull.mjs.map +1 -1
- package/_mjs/Stream/internal/Take.mjs +1 -1
- package/_mjs/Stream/internal/Take.mjs.map +1 -1
- package/_mjs/Stream.mjs +1 -2
- package/_mjs/Stream.mjs.map +1 -1
- package/_mjs/Subject.mjs +1 -2
- package/_mjs/Subject.mjs.map +1 -1
- package/_mjs/Supervisor/constructors.mjs +4 -2
- package/_mjs/Supervisor/constructors.mjs.map +1 -1
- package/_mjs/Supervisor.mjs +2 -3
- package/_mjs/Supervisor.mjs.map +1 -1
- package/_mjs/TExit.mjs +1 -2
- package/_mjs/TExit.mjs.map +1 -1
- package/_mjs/TFuture.mjs +2 -3
- package/_mjs/TFuture.mjs.map +1 -1
- package/_mjs/TReentrantLock/api.mjs +1 -1
- package/_mjs/TReentrantLock/api.mjs.map +1 -1
- package/_mjs/TReentrantLock.mjs +1 -2
- package/_mjs/TReentrantLock.mjs.map +1 -1
- package/_mjs/TRef.mjs +2 -3
- package/_mjs/TRef.mjs.map +1 -1
- package/_mjs/TSemaphore.mjs +2 -3
- package/_mjs/TSemaphore.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc.mjs +5 -6
- package/_mjs/collection/immutable/Conc.mjs.map +1 -1
- package/_src/Cached.ts +2 -3
- package/_src/Channel/ChildExecutorDecision.ts +1 -2
- package/_src/Channel/UpstreamPullRequest.ts +1 -2
- package/_src/Channel.ts +2 -3
- package/_src/Clock.ts +2 -3
- package/_src/Console.ts +2 -3
- package/_src/Fiber.ts +20 -21
- package/_src/FiberRef.ts +6 -7
- package/_src/FiberRefs.ts +1 -2
- package/_src/FiberScope.ts +1 -2
- package/_src/FiberStatus.ts +1 -2
- package/_src/Future/api.ts +9 -0
- package/_src/Future.ts +2 -3
- package/_src/Hub.ts +1 -2
- package/_src/IO.ts +63 -65
- package/_src/IOEnv.ts +2 -3
- package/_src/InterruptStatus.ts +1 -2
- package/_src/Layer.ts +1 -2
- package/_src/Logger.ts +2 -3
- package/_src/MVar.ts +1 -2
- package/_src/Push/internal.ts +2 -3
- package/_src/Push.ts +2 -3
- package/_src/Queue/api.ts +7 -8
- package/_src/Queue.ts +4 -5
- package/_src/Random.ts +2 -3
- package/_src/Ref/Synchronized.ts +2 -3
- package/_src/Ref/api.ts +7 -8
- package/_src/Ref.ts +7 -9
- package/_src/RefSubject.ts +1 -2
- package/_src/Reloadable.ts +2 -3
- package/_src/RuntimeFlags.ts +1 -2
- package/_src/STM.ts +5 -6
- package/_src/Schedule.ts +2 -3
- package/_src/Scope/ReleaseMap.ts +2 -3
- package/_src/Scope.ts +1 -2
- package/_src/ScopedRef.ts +1 -2
- package/_src/Semaphore.ts +116 -38
- package/_src/Sink.ts +1 -2
- package/_src/State.ts +1 -2
- package/_src/Stream.ts +1 -2
- package/_src/Subject.ts +1 -2
- package/_src/Supervisor/constructors.ts +2 -0
- package/_src/Supervisor.ts +2 -3
- package/_src/TExit.ts +1 -2
- package/_src/TFuture.ts +2 -3
- package/_src/TReentrantLock.ts +1 -2
- package/_src/TRef.ts +2 -3
- package/_src/TSemaphore.ts +2 -3
- package/_src/collection/immutable/Conc.ts +5 -6
- package/collection/immutable/Conc.d.ts +5 -5
- package/package.json +2 -2
package/_src/Logger.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: Logger/*.ts }
|
3
|
-
export * from "./Logger/definition.js";
|
4
|
-
export * from "./Logger/constructors.js";
|
5
2
|
export * from "./Logger/api.js";
|
3
|
+
export * from "./Logger/constructors.js";
|
4
|
+
export * from "./Logger/definition.js";
|
6
5
|
// codegen:end
|
package/_src/MVar.ts
CHANGED
package/_src/Push/internal.ts
CHANGED
@@ -56,9 +56,8 @@ export function withExhaust<R, E, A>(f: (fork: <R>(io: URIO<R, void>) => URIO<R,
|
|
56
56
|
const reset = ref.set(null);
|
57
57
|
|
58
58
|
const exhaustFork = <R>(io: IO<R, never, void>) =>
|
59
|
-
io
|
60
|
-
.
|
61
|
-
.fork.flatMap((fiber) => ref.set(fiber))
|
59
|
+
fork(io.ensuring(reset))
|
60
|
+
.flatMap((fiber) => ref.set(fiber))
|
62
61
|
.whenRef(ref, (fiber) => fiber === null).asUnit;
|
63
62
|
|
64
63
|
Δ(f(exhaustFork));
|
package/_src/Push.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ./Push/*.ts }
|
3
|
-
export * from "./Push/internal.js";
|
4
|
-
export * from "./Push/definition.js";
|
5
2
|
export * from "./Push/api.js";
|
3
|
+
export * from "./Push/definition.js";
|
4
|
+
export * from "./Push/internal.js";
|
6
5
|
// codegen:end
|
package/_src/Queue/api.ts
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: api/*.ts }
|
3
|
-
export * from "./api/zipWithIO.js";
|
4
|
-
export * from "./api/takeN.js";
|
5
|
-
export * from "./api/takeBetween.js";
|
6
|
-
export * from "./api/poll.js";
|
7
|
-
export * from "./api/operations.js";
|
8
|
-
export * from "./api/filterOutputIO.js";
|
9
|
-
export * from "./api/filterInputIO.js";
|
10
2
|
export * from "./api/dimapIO.js";
|
3
|
+
export * from "./api/filterInputIO.js";
|
4
|
+
export * from "./api/filterOutputIO.js";
|
5
|
+
export * from "./api/operations.js";
|
6
|
+
export * from "./api/poll.js";
|
7
|
+
export * from "./api/takeBetween.js";
|
8
|
+
export * from "./api/takeN.js";
|
9
|
+
export * from "./api/zipWithIO.js";
|
11
10
|
// codegen:end
|
package/_src/Queue.ts
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: Queue/*.ts }
|
3
|
-
export * from "./Queue/strategy.js";
|
4
|
-
export * from "./Queue/internal.js";
|
5
|
-
export * from "./Queue/definition.js";
|
6
|
-
export * from "./Queue/constructors.js";
|
7
2
|
export * from "./Queue/api.js";
|
3
|
+
export * from "./Queue/constructors.js";
|
4
|
+
export * from "./Queue/definition.js";
|
5
|
+
export * from "./Queue/internal.js";
|
6
|
+
export * from "./Queue/strategy.js";
|
8
7
|
// codegen:end
|
package/_src/Random.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ./Random/*.ts }
|
3
|
-
export * from "./Random/live.js";
|
4
|
-
export * from "./Random/definition.js";
|
5
2
|
export * from "./Random/api.js";
|
3
|
+
export * from "./Random/definition.js";
|
4
|
+
export * from "./Random/live.js";
|
6
5
|
// codegen:end
|
package/_src/Ref/Synchronized.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ./Synchronized/*.ts }
|
3
|
-
export * from "./Synchronized/definition.js";
|
4
|
-
export * from "./Synchronized/constructors.js";
|
5
2
|
export * from "./Synchronized/api.js";
|
3
|
+
export * from "./Synchronized/constructors.js";
|
4
|
+
export * from "./Synchronized/definition.js";
|
6
5
|
// codegen:end
|
package/_src/Ref/api.ts
CHANGED
@@ -2,16 +2,15 @@ import type { PRef } from "./definition.js";
|
|
2
2
|
|
3
3
|
import { identity } from "@fncts/base/data/function";
|
4
4
|
|
5
|
-
/* eslint-disable simple-import-sort/exports */
|
6
5
|
// codegen:start { preset: barrel, include: api/*.ts }
|
7
|
-
export * from "./api/set.js";
|
8
|
-
export * from "./api/modify.js";
|
9
|
-
export * from "./api/matchAll.js";
|
10
|
-
export * from "./api/match.js";
|
11
|
-
export * from "./api/get.js";
|
12
|
-
export * from "./api/filter.js";
|
13
|
-
export * from "./api/dimap.js";
|
14
6
|
export * from "./api/collect.js";
|
7
|
+
export * from "./api/dimap.js";
|
8
|
+
export * from "./api/filter.js";
|
9
|
+
export * from "./api/get.js";
|
10
|
+
export * from "./api/match.js";
|
11
|
+
export * from "./api/matchAll.js";
|
12
|
+
export * from "./api/modify.js";
|
13
|
+
export * from "./api/set.js";
|
15
14
|
// codegen:end
|
16
15
|
|
17
16
|
/**
|
package/_src/Ref.ts
CHANGED
@@ -1,17 +1,15 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: Ref/*.ts }
|
3
|
-
export * from "./Ref/definition.js";
|
4
|
-
export * from "./Ref/constructors.js";
|
5
2
|
export * from "./Ref/api.js";
|
6
|
-
export * from "./Ref/Synchronized.js";
|
7
|
-
export * from "./Ref/DerivedAll.js";
|
8
|
-
export * from "./Ref/Derived.js";
|
9
3
|
export * from "./Ref/Atomic.js";
|
4
|
+
export * from "./Ref/constructors.js";
|
5
|
+
export * from "./Ref/definition.js";
|
6
|
+
export * from "./Ref/Derived.js";
|
7
|
+
export * from "./Ref/DerivedAll.js";
|
8
|
+
export * from "./Ref/Synchronized.js";
|
10
9
|
// codegen:end
|
11
10
|
|
12
|
-
/* eslint-disable simple-import-sort/exports */
|
13
11
|
// codegen:start { preset: barrel, include: Ref/Synchronized/*.ts }
|
14
|
-
export * from "./Ref/Synchronized/definition.js";
|
15
|
-
export * from "./Ref/Synchronized/constructors.js";
|
16
12
|
export * from "./Ref/Synchronized/api.js";
|
13
|
+
export * from "./Ref/Synchronized/constructors.js";
|
14
|
+
export * from "./Ref/Synchronized/definition.js";
|
17
15
|
// codegen:end
|
package/_src/RefSubject.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ./RefSubject/*.ts }
|
3
|
-
export * from "./RefSubject/definition.js";
|
4
2
|
export * from "./RefSubject/api.js";
|
5
3
|
export * from "./RefSubject/Atomic.js";
|
4
|
+
export * from "./RefSubject/definition.js";
|
6
5
|
// codegen:end
|
package/_src/Reloadable.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ./Reloadable/*.ts }
|
3
|
-
export * from "./Reloadable/definition.js";
|
4
|
-
export * from "./Reloadable/constructors.js";
|
5
2
|
export * from "./Reloadable/api.js";
|
3
|
+
export * from "./Reloadable/constructors.js";
|
4
|
+
export * from "./Reloadable/definition.js";
|
6
5
|
// codegen:end
|
package/_src/RuntimeFlags.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: RuntimeFlags/*.ts }
|
3
|
-
export * from "./RuntimeFlags/RuntimeFlags.js";
|
4
2
|
export * from "./RuntimeFlags/Patch.js";
|
3
|
+
export * from "./RuntimeFlags/RuntimeFlags.js";
|
5
4
|
// codegen:end
|
package/_src/STM.ts
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: STM/*.ts }
|
3
|
-
export * from "./STM/driver.js";
|
4
|
-
export * from "./STM/definition.js";
|
5
2
|
export * from "./STM/api.js";
|
3
|
+
export * from "./STM/definition.js";
|
4
|
+
export * from "./STM/driver.js";
|
6
5
|
// codegen:end
|
7
|
-
|
6
|
+
|
8
7
|
// codegen:start { preset: barrel, include: STM/api/*.ts }
|
9
|
-
export * from "./STM/api/core-constructors.js";
|
10
|
-
export * from "./STM/api/core-api.js";
|
11
8
|
export * from "./STM/api/atomically.js";
|
9
|
+
export * from "./STM/api/core-api.js";
|
10
|
+
export * from "./STM/api/core-constructors.js";
|
12
11
|
// codegen:end
|
package/_src/Schedule.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ./Schedule/*.ts }
|
3
|
-
export * from "./Schedule/definition.js";
|
4
2
|
export * from "./Schedule/api.js";
|
5
|
-
export * from "./Schedule/Driver.js";
|
6
3
|
export * from "./Schedule/Decision.js";
|
4
|
+
export * from "./Schedule/definition.js";
|
5
|
+
export * from "./Schedule/Driver.js";
|
7
6
|
// codegen:end
|
package/_src/Scope/ReleaseMap.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ReleaseMap/*.ts }
|
3
|
-
export * from "./ReleaseMap/definition.js";
|
4
|
-
export * from "./ReleaseMap/constructors.js";
|
5
2
|
export * from "./ReleaseMap/api.js";
|
3
|
+
export * from "./ReleaseMap/constructors.js";
|
4
|
+
export * from "./ReleaseMap/definition.js";
|
6
5
|
// codegen:end
|
package/_src/Scope.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ./Scope/*.ts, exclude: Scope/*(ReleaseMap|Finalizer).ts }
|
3
|
-
export * from "./Scope/definition.js";
|
4
2
|
export * from "./Scope/api.js";
|
3
|
+
export * from "./Scope/definition.js";
|
5
4
|
// codegen:end
|
package/_src/ScopedRef.ts
CHANGED
package/_src/Semaphore.ts
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
import { EitherTag } from "@fncts/base/data/Either";
|
2
|
+
import { IllegalArgumentError } from "@fncts/base/data/exceptions";
|
3
|
+
|
1
4
|
/**
|
2
5
|
* @tsplus type fncts.io.Semaphore
|
3
6
|
* @tsplus companion fncts.io.SemaphoreOps
|
@@ -5,57 +8,113 @@
|
|
5
8
|
export class Semaphore {
|
6
9
|
constructor(readonly permits: number) {}
|
7
10
|
|
8
|
-
|
9
|
-
waiters = new Set<() => void>();
|
11
|
+
ref = Ref.unsafeMake<Either<ImmutableQueue<[Future<never, void>, number]>, number>>(Either.right(this.permits));
|
10
12
|
|
11
|
-
|
12
|
-
return this.
|
13
|
+
available(__tsplusTrace?: string): UIO<number> {
|
14
|
+
return this.ref.get.map((_) =>
|
15
|
+
_.match(
|
16
|
+
() => 0,
|
17
|
+
(permits) => permits,
|
18
|
+
),
|
19
|
+
);
|
13
20
|
}
|
14
21
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
reserve(n: number, __tsplusTrace?: string): UIO<Reservation> {
|
23
|
+
if (n < 0) {
|
24
|
+
return IO.halt(new IllegalArgumentError(`Unexpected negative ${n} permits requested`, "Semaphore.reserve"));
|
25
|
+
} else if (n === 0) {
|
26
|
+
return IO.succeedNow(new Reservation(IO.unit, IO.unit));
|
27
|
+
} else {
|
28
|
+
return Future.make<never, void>().flatMap((future) =>
|
29
|
+
this.ref.modify((state) =>
|
30
|
+
state.match(
|
31
|
+
(queue) => [
|
32
|
+
new Reservation(future.await, this.restore(future, n)),
|
33
|
+
Either.left(queue.enqueue([future, n])),
|
34
|
+
],
|
35
|
+
(permits) => {
|
36
|
+
if (permits >= n) {
|
37
|
+
return [new Reservation(IO.unit, this.releaseN(n)), Either.right(permits - n)];
|
38
|
+
} else {
|
39
|
+
return [
|
40
|
+
new Reservation(future.await, this.restore(future, n)),
|
41
|
+
Either.left(ImmutableQueue.single([future, n - permits])),
|
42
|
+
];
|
43
|
+
}
|
44
|
+
},
|
45
|
+
),
|
46
|
+
),
|
47
|
+
);
|
20
48
|
}
|
21
49
|
}
|
22
50
|
|
23
|
-
|
24
|
-
return
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
51
|
+
restore(future: Future<never, void>, n: number, __tsplusTrace?: string): UIO<void> {
|
52
|
+
return this.ref.modify((state) =>
|
53
|
+
state.match(
|
54
|
+
(queue) =>
|
55
|
+
queue
|
56
|
+
.find(([waiter]) => waiter === future)
|
57
|
+
.match(
|
58
|
+
() => [this.releaseN(n), Either.left(queue)],
|
59
|
+
([_, permits]) => [
|
60
|
+
this.releaseN(n - permits),
|
61
|
+
Either.left(queue.filter(([waiter]) => waiter !== future)),
|
62
|
+
],
|
63
|
+
),
|
64
|
+
(permits) => [IO.unit, Either.right(permits + n)],
|
65
|
+
),
|
66
|
+
).flatten;
|
67
|
+
}
|
68
|
+
|
69
|
+
releaseN(n: number, __tsplusTrace?: string): UIO<void> {
|
70
|
+
const self = this;
|
71
|
+
|
72
|
+
/**
|
73
|
+
* @tsplus tailRec
|
74
|
+
*/
|
75
|
+
function loop(
|
76
|
+
n: number,
|
77
|
+
state: Either<ImmutableQueue<[Future<never, any>, number]>, number>,
|
78
|
+
acc: UIO<void>,
|
79
|
+
): [UIO<void>, Either<ImmutableQueue<[Future<never, any>, number]>, number>] {
|
80
|
+
state.concrete();
|
81
|
+
switch (state._tag) {
|
82
|
+
case EitherTag.Right: {
|
83
|
+
return [acc, Either.right(state.right + n)];
|
84
|
+
}
|
85
|
+
case EitherTag.Left: {
|
86
|
+
const waiter = state.left.dequeue;
|
87
|
+
|
88
|
+
Maybe.concrete(waiter);
|
89
|
+
|
90
|
+
switch (waiter._tag) {
|
91
|
+
case MaybeTag.Nothing: {
|
92
|
+
return [acc, Either.right(self.permits)];
|
93
|
+
}
|
94
|
+
case MaybeTag.Just: {
|
95
|
+
const [[future, permits], queue] = waiter.value;
|
96
|
+
if (n > permits) {
|
97
|
+
return loop(n - permits, Either.left(queue), acc.zipLeft(future.succeed(undefined)));
|
98
|
+
} else if (n === permits) {
|
99
|
+
return [acc.zipRight(future.succeed().asUnit), Either.left(queue)];
|
100
|
+
} else {
|
101
|
+
return [acc, Either.left(queue.prepend([future, permits - n]))];
|
102
|
+
}
|
103
|
+
}
|
31
104
|
}
|
32
|
-
}
|
33
|
-
this.waiters.add(observer);
|
34
|
-
return Either.left(
|
35
|
-
IO(() => {
|
36
|
-
this.waiters.delete(observer);
|
37
|
-
}),
|
38
|
-
);
|
105
|
+
}
|
39
106
|
}
|
40
|
-
|
41
|
-
return Either.right(IO.succeedNow(n));
|
42
|
-
});
|
43
|
-
}
|
107
|
+
}
|
44
108
|
|
45
|
-
|
46
|
-
return IO.withFiberRuntime<never, never, void>((fiber) => {
|
47
|
-
this.taken -= n;
|
48
|
-
fiber.getFiberRef(FiberRef.currentScheduler).scheduleTask(() => {
|
49
|
-
this.waiters.forEach((wake) => wake());
|
50
|
-
});
|
51
|
-
return IO.unit;
|
52
|
-
});
|
109
|
+
return this.ref.modify((state) => loop(n, state, IO.unit)).flatten;
|
53
110
|
}
|
54
111
|
|
55
112
|
withPermits(permits: number) {
|
56
113
|
return <R, E, A>(io: IO<R, E, A>): IO<R, E, A> => {
|
57
|
-
return IO.
|
58
|
-
|
114
|
+
return IO.bracket(
|
115
|
+
this.reserve(permits),
|
116
|
+
(reservation) => reservation.acquire > io,
|
117
|
+
(reservation) => reservation.release,
|
59
118
|
);
|
60
119
|
};
|
61
120
|
}
|
@@ -63,6 +122,25 @@ export class Semaphore {
|
|
63
122
|
withPermit<R, E, A>(io: IO<R, E, A>): IO<R, E, A> {
|
64
123
|
return this.withPermits(1)(io);
|
65
124
|
}
|
125
|
+
|
126
|
+
withPermitsScoped(permits: number) {
|
127
|
+
return <R, E, A>(io: IO<R, E, A>): IO<Scope | R, E, A> => {
|
128
|
+
return IO.acquireRelease(this.reserve(permits), (reservation) => reservation.release).flatMap(
|
129
|
+
(reservation) => reservation.acquire > io,
|
130
|
+
);
|
131
|
+
};
|
132
|
+
}
|
133
|
+
|
134
|
+
withPermitScoped<R, E, A>(io: IO<R, E, A>): IO<Scope | R, E, A> {
|
135
|
+
return this.withPermitsScoped(1)(io);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
export class Reservation {
|
140
|
+
constructor(
|
141
|
+
readonly acquire: UIO<void>,
|
142
|
+
readonly release: UIO<void>,
|
143
|
+
) {}
|
66
144
|
}
|
67
145
|
|
68
146
|
/**
|
package/_src/Sink.ts
CHANGED
package/_src/State.ts
CHANGED
package/_src/Stream.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ./Stream/*.ts, exclude: Stream/*(DebounceState|Handoff|Pull|SinkEndReason|Take).ts }
|
3
|
-
export * from "./Stream/definition.js";
|
4
2
|
export * from "./Stream/api.js";
|
3
|
+
export * from "./Stream/definition.js";
|
5
4
|
// codegen:end
|
package/_src/Subject.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ./Subject/*.ts }
|
3
|
-
export * from "./Subject/definition.js";
|
4
2
|
export * from "./Subject/api.js";
|
5
3
|
export * from "./Subject/Atomic.js";
|
4
|
+
export * from "./Subject/definition.js";
|
6
5
|
// codegen:end
|
@@ -17,9 +17,11 @@ export function unsafeTrack(weak: boolean): Supervisor<Conc<Fiber.Runtime<any, a
|
|
17
17
|
_parent: Maybe<Fiber.Runtime<E, A>>,
|
18
18
|
fiber: Fiber.Runtime<E, A>,
|
19
19
|
) {
|
20
|
+
// @ts-expect-error
|
20
21
|
set.add(fiber);
|
21
22
|
}
|
22
23
|
unsafeOnEnd<E, A>(_value: Exit<E, A>, fiber: Fiber.Runtime<E, A>) {
|
24
|
+
// @ts-expect-error
|
23
25
|
set.delete(fiber);
|
24
26
|
}
|
25
27
|
})();
|
package/_src/Supervisor.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: Supervisor/*.ts }
|
3
|
-
export * from "./Supervisor/definition.js";
|
4
|
-
export * from "./Supervisor/constructors.js";
|
5
2
|
export * from "./Supervisor/api.js";
|
3
|
+
export * from "./Supervisor/constructors.js";
|
4
|
+
export * from "./Supervisor/definition.js";
|
6
5
|
// codegen:end
|
package/_src/TExit.ts
CHANGED
package/_src/TFuture.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: TFuture/*.ts }
|
3
|
-
export * from "./TFuture/definition.js";
|
4
|
-
export * from "./TFuture/constructors.js";
|
5
2
|
export * from "./TFuture/api.js";
|
3
|
+
export * from "./TFuture/constructors.js";
|
4
|
+
export * from "./TFuture/definition.js";
|
6
5
|
// codegen:end
|
package/_src/TReentrantLock.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: TReentrantLock/*.ts }
|
3
|
-
export * from "./TReentrantLock/definition.js";
|
4
2
|
export * from "./TReentrantLock/api.js";
|
3
|
+
export * from "./TReentrantLock/definition.js";
|
5
4
|
// codegen:end
|
package/_src/TRef.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: TRef/*.ts }
|
3
|
-
export * from "./TRef/definition.js";
|
4
|
-
export * from "./TRef/constructors.js";
|
5
2
|
export * from "./TRef/api.js";
|
3
|
+
export * from "./TRef/constructors.js";
|
4
|
+
export * from "./TRef/definition.js";
|
6
5
|
// codegen:end
|
package/_src/TSemaphore.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: TSemaphore/*.ts }
|
3
|
-
export * from "./TSemaphore/definition.js";
|
4
|
-
export * from "./TSemaphore/constructors.js";
|
5
2
|
export * from "./TSemaphore/api.js";
|
3
|
+
export * from "./TSemaphore/constructors.js";
|
4
|
+
export * from "./TSemaphore/definition.js";
|
6
5
|
// codegen:end
|
@@ -1,9 +1,8 @@
|
|
1
|
-
/* eslint-disable simple-import-sort/exports */
|
2
1
|
// codegen:start { preset: barrel, include: ./Conc/*.ts }
|
3
|
-
export * from "./Conc/takeWhileIO.js";
|
4
|
-
export * from "./Conc/mapIO.js";
|
5
|
-
export * from "./Conc/findIO.js";
|
6
|
-
export * from "./Conc/filterIO.js";
|
7
|
-
export * from "./Conc/dropWhileIO.js";
|
8
2
|
export * from "./Conc/dropUntilIO.js";
|
3
|
+
export * from "./Conc/dropWhileIO.js";
|
4
|
+
export * from "./Conc/filterIO.js";
|
5
|
+
export * from "./Conc/findIO.js";
|
6
|
+
export * from "./Conc/mapIO.js";
|
7
|
+
export * from "./Conc/takeWhileIO.js";
|
9
8
|
// codegen:end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from "./Conc/takeWhileIO.js";
|
2
|
-
export * from "./Conc/mapIO.js";
|
3
|
-
export * from "./Conc/findIO.js";
|
4
|
-
export * from "./Conc/filterIO.js";
|
5
|
-
export * from "./Conc/dropWhileIO.js";
|
6
1
|
export * from "./Conc/dropUntilIO.js";
|
2
|
+
export * from "./Conc/dropWhileIO.js";
|
3
|
+
export * from "./Conc/filterIO.js";
|
4
|
+
export * from "./Conc/findIO.js";
|
5
|
+
export * from "./Conc/mapIO.js";
|
6
|
+
export * from "./Conc/takeWhileIO.js";
|