@fncts/io 0.0.17 → 0.0.19
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/internal.d.ts +1 -1
- package/CancellerState.d.ts +1 -1
- package/Channel/ChildExecutorDecision/definition.d.ts +1 -1
- package/Channel/UpstreamPullRequest/definition.d.ts +1 -1
- package/Channel/UpstreamPullStrategy/definition.d.ts +1 -1
- package/Channel/api/mergeAllWith.d.ts +1 -1
- package/Channel/internal/ChannelExecutor.d.ts +1 -1
- package/Channel/internal/ChannelState.d.ts +2 -2
- package/Channel/internal/MergeDecision.d.ts +1 -1
- package/Channel/internal/MergeState.d.ts +1 -1
- package/Channel/internal/SingleProducerAsyncInput.d.ts +1 -1
- package/Clock/definition.d.ts +1 -0
- package/Fiber/FiberContext.d.ts +22 -19
- package/Fiber/api/interruptAll.d.ts +1 -1
- package/Fiber/api/interruptAsFork.d.ts +8 -0
- package/Fiber/definition.d.ts +6 -8
- package/FiberRef/api.d.ts +7 -2
- package/FiberRef/definition.d.ts +4 -3
- package/FiberRef/unsafe.d.ts +18 -1
- package/FiberRefs/api.d.ts +5 -0
- package/FiberRefs/definition.d.ts +1 -1
- package/FiberState/definition.d.ts +2 -2
- package/FiberStatus/definition.d.ts +1 -1
- package/Future/definition.d.ts +1 -1
- package/Hub/definition.d.ts +1 -1
- package/IO/api/core-scope.d.ts +4 -3
- package/IO/api/interrupt.d.ts +2 -2
- package/IO/api/supervised.d.ts +10 -0
- package/IO/api.d.ts +7 -10
- package/IO/definition.d.ts +16 -139
- package/IO.d.ts +1 -0
- package/IOEnv/definition.d.ts +1 -1
- package/Layer/definition.d.ts +2 -2
- package/Ref/definition.d.ts +3 -3
- package/Reloadable/api.d.ts +21 -0
- package/Reloadable/constructors.d.ts +23 -0
- package/Reloadable/definition.d.ts +20 -0
- package/Reloadable.d.ts +3 -0
- package/RuntimeConfig.d.ts +1 -1
- package/STM/definition.d.ts +5 -5
- package/STM/internal/CommitState.d.ts +1 -1
- package/STM/internal/Entry.d.ts +2 -2
- package/STM/internal/Journal.d.ts +6 -6
- package/STM/internal/TryCommit.d.ts +2 -2
- package/STM/internal/Versioned.d.ts +1 -1
- package/Schedule/Decision.d.ts +1 -1
- package/Scope/ReleaseMap/definition.d.ts +1 -1
- package/Scope/definition.d.ts +2 -2
- package/ScopedRef/definition.d.ts +1 -1
- package/State/internal.d.ts +1 -1
- package/Stream/api.d.ts +1 -1
- package/Stream/definition.d.ts +1 -1
- package/Stream/internal/DebounceState.d.ts +4 -4
- package/Stream/internal/Handoff.d.ts +5 -5
- package/Stream/internal/Pull.d.ts +1 -1
- package/Stream/internal/SinkEndReason.d.ts +1 -1
- package/TExit/definition.d.ts +3 -3
- package/TReentrantLock/definition.d.ts +1 -1
- package/TRef/definition.d.ts +1 -1
- package/TxnId.d.ts +1 -1
- package/_cjs/Clock/definition.cjs +2 -1
- package/_cjs/Clock/definition.cjs.map +1 -1
- package/_cjs/Console/definition.cjs +1 -1
- package/_cjs/Console/definition.cjs.map +1 -1
- package/_cjs/Fiber/FiberContext.cjs +180 -310
- package/_cjs/Fiber/FiberContext.cjs.map +1 -1
- package/_cjs/Fiber/api/collectAll.cjs +2 -2
- package/_cjs/Fiber/api/collectAll.cjs.map +1 -1
- package/_cjs/Fiber/api/interrupt.cjs +4 -2
- package/_cjs/Fiber/api/interrupt.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAll.cjs +8 -8
- package/_cjs/Fiber/api/interruptAll.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAs.cjs +7 -1
- package/_cjs/Fiber/api/interruptAs.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptAsFork.cjs +15 -0
- package/_cjs/Fiber/api/interruptAsFork.cjs.map +1 -0
- package/_cjs/Fiber/api/interruptFork.cjs +5 -5
- package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
- package/_cjs/Fiber/definition.cjs +2 -2
- package/_cjs/Fiber/definition.cjs.map +1 -1
- package/_cjs/FiberRef/api.cjs +29 -10
- package/_cjs/FiberRef/api.cjs.map +1 -1
- package/_cjs/FiberRef/definition.cjs +2 -1
- package/_cjs/FiberRef/definition.cjs.map +1 -1
- package/_cjs/FiberRef/unsafe.cjs +29 -5
- package/_cjs/FiberRef/unsafe.cjs.map +1 -1
- package/_cjs/FiberRefs/api.cjs +28 -2
- package/_cjs/FiberRefs/api.cjs.map +1 -1
- package/_cjs/FiberRefs/join.cjs +1 -1
- package/_cjs/FiberRefs/join.cjs.map +1 -1
- package/_cjs/IO/api/core-scope.cjs +23 -15
- package/_cjs/IO/api/core-scope.cjs.map +1 -1
- package/_cjs/IO/api/ensuringChildren.cjs +4 -2
- package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
- package/_cjs/IO/api/interrupt.cjs +21 -11
- package/_cjs/IO/api/interrupt.cjs.map +1 -1
- package/_cjs/IO/api/supervised.cjs +26 -0
- package/_cjs/IO/api/supervised.cjs.map +1 -0
- package/_cjs/IO/api/withChildren.cjs +4 -2
- package/_cjs/IO/api/withChildren.cjs.map +1 -1
- package/_cjs/IO/api/zipC.cjs +10 -8
- package/_cjs/IO/api/zipC.cjs.map +1 -1
- package/_cjs/IO/api.cjs +67 -63
- package/_cjs/IO/api.cjs.map +1 -1
- package/_cjs/IO/definition.cjs +8 -226
- package/_cjs/IO/definition.cjs.map +1 -1
- package/_cjs/IO/runtime.cjs +7 -9
- package/_cjs/IO/runtime.cjs.map +1 -1
- package/_cjs/IO.cjs +13 -0
- package/_cjs/IO.cjs.map +1 -1
- package/_cjs/Layer/api.cjs +1 -1
- package/_cjs/Layer/api.cjs.map +1 -1
- package/_cjs/Random/definition.cjs +1 -1
- package/_cjs/Random/definition.cjs.map +1 -1
- package/_cjs/Reloadable/api.cjs +46 -0
- package/_cjs/Reloadable/api.cjs.map +1 -0
- package/_cjs/Reloadable/constructors.cjs +82 -0
- package/_cjs/Reloadable/constructors.cjs.map +1 -0
- package/_cjs/Reloadable/definition.cjs +58 -0
- package/_cjs/Reloadable/definition.cjs.map +1 -0
- package/_cjs/Reloadable.cjs +45 -0
- package/_cjs/Reloadable.cjs.map +1 -0
- package/_cjs/Scope/definition.cjs +1 -1
- package/_cjs/Scope/definition.cjs.map +1 -1
- package/_cjs/internal/IsFatal.cjs +129 -0
- package/_cjs/internal/IsFatal.cjs.map +1 -0
- package/_mjs/Clock/definition.mjs +2 -1
- package/_mjs/Clock/definition.mjs.map +1 -1
- package/_mjs/Console/definition.mjs +1 -1
- package/_mjs/Console/definition.mjs.map +1 -1
- package/_mjs/Fiber/FiberContext.mjs +180 -309
- package/_mjs/Fiber/FiberContext.mjs.map +1 -1
- package/_mjs/Fiber/api/collectAll.mjs +2 -2
- package/_mjs/Fiber/api/collectAll.mjs.map +1 -1
- package/_mjs/Fiber/api/interrupt.mjs +3 -2
- package/_mjs/Fiber/api/interrupt.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAll.mjs +6 -6
- package/_mjs/Fiber/api/interruptAll.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAs.mjs +3 -1
- package/_mjs/Fiber/api/interruptAs.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptAsFork.mjs +8 -0
- package/_mjs/Fiber/api/interruptAsFork.mjs.map +1 -0
- package/_mjs/Fiber/api/interruptFork.mjs +5 -4
- package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
- package/_mjs/Fiber/definition.mjs +2 -2
- package/_mjs/Fiber/definition.mjs.map +1 -1
- package/_mjs/FiberRef/api.mjs +26 -9
- package/_mjs/FiberRef/api.mjs.map +1 -1
- package/_mjs/FiberRef/definition.mjs +2 -1
- package/_mjs/FiberRef/definition.mjs.map +1 -1
- package/_mjs/FiberRef/unsafe.mjs +23 -4
- package/_mjs/FiberRef/unsafe.mjs.map +1 -1
- package/_mjs/FiberRefs/api.mjs +22 -1
- package/_mjs/FiberRefs/api.mjs.map +1 -1
- package/_mjs/FiberRefs/join.mjs +1 -1
- package/_mjs/FiberRefs/join.mjs.map +1 -1
- package/_mjs/IO/api/core-scope.mjs +21 -16
- package/_mjs/IO/api/core-scope.mjs.map +1 -1
- package/_mjs/IO/api/ensuringChildren.mjs +3 -2
- package/_mjs/IO/api/ensuringChildren.mjs.map +1 -1
- package/_mjs/IO/api/interrupt.mjs +18 -9
- package/_mjs/IO/api/interrupt.mjs.map +1 -1
- package/_mjs/IO/api/supervised.mjs +14 -0
- package/_mjs/IO/api/supervised.mjs.map +1 -0
- package/_mjs/IO/api/withChildren.mjs +3 -2
- package/_mjs/IO/api/withChildren.mjs.map +1 -1
- package/_mjs/IO/api/zipC.mjs +9 -8
- package/_mjs/IO/api/zipC.mjs.map +1 -1
- package/_mjs/IO/api.mjs +66 -60
- package/_mjs/IO/api.mjs.map +1 -1
- package/_mjs/IO/definition.mjs +5 -184
- package/_mjs/IO/definition.mjs.map +1 -1
- package/_mjs/IO/runtime.mjs +7 -8
- package/_mjs/IO/runtime.mjs.map +1 -1
- package/_mjs/IO.mjs +1 -0
- package/_mjs/IO.mjs.map +1 -1
- package/_mjs/Layer/api.mjs +1 -1
- package/_mjs/Layer/api.mjs.map +1 -1
- package/_mjs/Random/definition.mjs +1 -1
- package/_mjs/Random/definition.mjs.map +1 -1
- package/_mjs/Reloadable/api.mjs +30 -0
- package/_mjs/Reloadable/api.mjs.map +1 -0
- package/_mjs/Reloadable/constructors.mjs +55 -0
- package/_mjs/Reloadable/constructors.mjs.map +1 -0
- package/_mjs/Reloadable/definition.mjs +40 -0
- package/_mjs/Reloadable/definition.mjs.map +1 -0
- package/_mjs/Reloadable.mjs +5 -0
- package/_mjs/Reloadable.mjs.map +1 -0
- package/_mjs/Scope/definition.mjs +1 -1
- package/_mjs/Scope/definition.mjs.map +1 -1
- package/_mjs/internal/IsFatal.mjs +104 -0
- package/_mjs/internal/IsFatal.mjs.map +1 -0
- package/_src/Clock/definition.ts +1 -0
- package/_src/Fiber/FiberContext.ts +50 -135
- package/_src/Fiber/api/collectAll.ts +1 -4
- package/_src/Fiber/api/interruptAll.ts +2 -2
- package/_src/Fiber/api/interruptAs.ts +1 -1
- package/_src/Fiber/api/interruptAsFork.ts +7 -0
- package/_src/Fiber/api/interruptFork.ts +1 -1
- package/_src/Fiber/definition.ts +3 -5
- package/_src/FiberRef/api.ts +30 -7
- package/_src/FiberRef/definition.ts +1 -0
- package/_src/FiberRef/unsafe.ts +27 -3
- package/_src/FiberRefs/api.ts +16 -0
- package/_src/FiberRefs/join.ts +1 -1
- package/_src/IO/api/core-scope.ts +12 -10
- package/_src/IO/api/interrupt.ts +8 -3
- package/_src/IO/api/supervised.ts +14 -0
- package/_src/IO/api.ts +25 -26
- package/_src/IO/definition.ts +8 -158
- package/_src/IO/runtime.ts +7 -11
- package/_src/IO.ts +1 -0
- package/_src/Reloadable/api.ts +28 -0
- package/_src/Reloadable/constructors.ts +60 -0
- package/_src/Reloadable/definition.ts +34 -0
- package/_src/Reloadable.ts +5 -0
- package/_src/internal/IsFatal.ts +79 -0
- package/internal/IsFatal.d.ts +47 -0
- package/package.json +4 -4
package/Cached/internal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FIO } from "@fncts/io/IO/definition";
|
|
2
2
|
export declare const CachedTypeId: unique symbol;
|
|
3
|
-
export
|
|
3
|
+
export type CachedTypeId = typeof CachedTypeId;
|
|
4
4
|
export declare abstract class CachedInternal<Error, Resource> {
|
|
5
5
|
readonly _E: () => Error;
|
|
6
6
|
readonly _A: () => Resource;
|
package/CancellerState.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare class Registered {
|
|
|
18
18
|
/**
|
|
19
19
|
* @tsplus type fncts.CancellerState
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type CancellerState = Empty | Pending | Registered;
|
|
22
22
|
/**
|
|
23
23
|
* @tsplus type fncts.CancellerStateOps
|
|
24
24
|
*/
|
|
@@ -26,7 +26,7 @@ export declare const Yield: ChildExecutorDecision;
|
|
|
26
26
|
/**
|
|
27
27
|
* @tsplus type fncts.io.Channel.ChildExecutorDecision
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
29
|
+
export type ChildExecutorDecision = Continue | Close | Yield;
|
|
30
30
|
/**
|
|
31
31
|
* @tsplus type fncts.io.Channel.ChildExecutorDecisionOps
|
|
32
32
|
*/
|
|
@@ -11,7 +11,7 @@ export declare class NoUpstream {
|
|
|
11
11
|
/**
|
|
12
12
|
* @tsplus type fncts.io.Channel.UpstreamPullRequest
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type UpstreamPullRequest<A> = Pulled<A> | NoUpstream;
|
|
15
15
|
/**
|
|
16
16
|
* @tsplus type fncts.io.Channel.UpstreamPullRequestOps
|
|
17
17
|
*/
|
|
@@ -17,7 +17,7 @@ export interface PullAfterAllEnqueued<A> {
|
|
|
17
17
|
* @tsplus location "@fncts/io/Channel/UpstreamPullStrategy/definition"
|
|
18
18
|
*/
|
|
19
19
|
export declare function PullAfterAllEnqueued<A>(emitSeparator: Maybe<A>): UpstreamPullStrategy<A>;
|
|
20
|
-
export
|
|
20
|
+
export type UpstreamPullStrategy<A> = PullAfterNext<A> | PullAfterAllEnqueued<A>;
|
|
21
21
|
/**
|
|
22
22
|
* @tsplus type fncts.io.Channel.UpstreamPullStrategyOps
|
|
23
23
|
*/
|
|
@@ -3,7 +3,7 @@ import { IO } from "@fncts/io/IO/definition";
|
|
|
3
3
|
import { Either } from "@fncts/base/data/Either/definition";
|
|
4
4
|
import { Future } from "@fncts/io/Future";
|
|
5
5
|
import { Maybe } from "@fncts/base/data/Maybe/definition";
|
|
6
|
-
export
|
|
6
|
+
export type MergeStrategy = "BackPressure" | "BufferSliding";
|
|
7
7
|
/**
|
|
8
8
|
* @tsplus fluent fncts.io.Channel mergeAllWith
|
|
9
9
|
* @tsplus location "@fncts/io/Channel/api/mergeAllWith"
|
|
@@ -8,7 +8,7 @@ import { ListBuffer } from "@fncts/base/collection/mutable/ListBuffer";
|
|
|
8
8
|
import { Maybe } from "@fncts/base/data/Maybe/definition";
|
|
9
9
|
import type { ChannelState } from "@fncts/io/Channel/internal/ChannelState";
|
|
10
10
|
import * as State from "@fncts/io/Channel/internal/ChannelState";
|
|
11
|
-
export
|
|
11
|
+
export type ErasedExecutor<R> = ChannelExecutor<R, unknown, unknown, unknown, unknown, unknown, unknown>;
|
|
12
12
|
export declare function readUpstream<R, E, A>(r: State.Read<R, E>, cont: () => IO<R, E, A>): IO<R, E, A>;
|
|
13
13
|
export declare class ChannelExecutor<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone> {
|
|
14
14
|
private providedEnv;
|
|
@@ -8,7 +8,7 @@ export declare const enum ChannelStateTag {
|
|
|
8
8
|
Read = "Read"
|
|
9
9
|
}
|
|
10
10
|
export declare const ChannelStateTypeId: unique symbol;
|
|
11
|
-
export
|
|
11
|
+
export type ChannelStateTypeId = typeof ChannelStateTypeId;
|
|
12
12
|
export declare class Emit {
|
|
13
13
|
readonly _tag = ChannelStateTag.Emit;
|
|
14
14
|
readonly _R: (_: unknown) => void;
|
|
@@ -40,5 +40,5 @@ export declare class Read<R, E> {
|
|
|
40
40
|
constructor(upstream: ErasedExecutor<R> | null, onEffect: (_: IO<R, never, void>) => IO<R, never, void>, onEmit: (_: any) => IO<R, never, void> | null, onDone: (exit: Exit<any, any>) => IO<R, never, void> | null);
|
|
41
41
|
get effect(): IO<R, E, any>;
|
|
42
42
|
}
|
|
43
|
-
export
|
|
43
|
+
export type ChannelState<R, E> = Emit | Done | Effect<R, E> | Read<R, E>;
|
|
44
44
|
export declare function effectOrNullIgnored<R, E>(channelState: ChannelState<R, E> | null): IO<R, never, void> | null;
|
|
@@ -5,7 +5,7 @@ export declare const enum MergeDecisionTag {
|
|
|
5
5
|
Await = "Await"
|
|
6
6
|
}
|
|
7
7
|
export declare const MergeDecisionTypeId: unique symbol;
|
|
8
|
-
export
|
|
8
|
+
export type MergeDecisionTypeId = typeof MergeDecisionTypeId;
|
|
9
9
|
/**
|
|
10
10
|
* @tsplus type fncts.io.Channel.MergeDecision
|
|
11
11
|
* @tsplus companion fncts.io.Channel.MergeDecisionOps
|
|
@@ -26,7 +26,7 @@ export declare class RightDone<Env, Err, Err1, Err2, Elem, Done, Done1, Done2> {
|
|
|
26
26
|
/**
|
|
27
27
|
* @tsplus type fncts.io.Channel.MergeState
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
29
|
+
export type MergeState<Env, Err, Err1, Err2, Elem, Done, Done1, Done2> = BothRunning<Env, Err, Err1, Err2, Elem, Done, Done1, Done2> | LeftDone<Env, Err, Err1, Err2, Elem, Done, Done1, Done2> | RightDone<Env, Err, Err1, Err2, Elem, Done, Done1, Done2>;
|
|
30
30
|
/**
|
|
31
31
|
* @tsplus type fncts.io.Channel.MergeStateOps
|
|
32
32
|
*/
|
|
@@ -34,7 +34,7 @@ export declare class StateEmit<Err, Elem, Done> {
|
|
|
34
34
|
readonly _stateTag = StateTag.Emit;
|
|
35
35
|
constructor(notifyConsumers: Queue<Future<Err, Either<Done, Elem>>>);
|
|
36
36
|
}
|
|
37
|
-
export
|
|
37
|
+
export type State<Err, Elem, Done> = StateEmpty | StateEmit<Err, Elem, Done> | StateError<Err> | StateDone<Done>;
|
|
38
38
|
/**
|
|
39
39
|
* An MVar-like abstraction for sending data to channels asynchronously. Designed
|
|
40
40
|
* for one producer and multiple consumers.
|
package/Clock/definition.d.ts
CHANGED
package/Fiber/FiberContext.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { Maybe, Nothing, Just } from "@fncts/base/data/Maybe/definition";
|
|
|
7
7
|
import { Fiber } from "@fncts/io/Fiber/definition";
|
|
8
8
|
import { Hashable } from "@fncts/base/typeclass/Hashable";
|
|
9
9
|
import { Equatable } from "@fncts/base/typeclass/Equatable";
|
|
10
|
-
import { Supervisor } from "@fncts/io/Supervisor/definition";
|
|
11
10
|
import { RuntimeConfig, RuntimeConfigFlag } from "@fncts/io/RuntimeConfig";
|
|
12
11
|
import { FiberRefs } from "@fncts/io/FiberRefs";
|
|
13
12
|
import { Conc, ConcBuilder } from "@fncts/base/collection/immutable/Conc";
|
|
@@ -16,10 +15,11 @@ import { Exit } from "@fncts/base/data/Exit/definition";
|
|
|
16
15
|
import { Either } from "@fncts/base/data/Either/definition";
|
|
17
16
|
import { FiberScope } from "@fncts/io/FiberScope";
|
|
18
17
|
import { Trace } from "@fncts/base/data/Trace/definition";
|
|
18
|
+
import { Supervisor } from "@fncts/io/Supervisor/definition";
|
|
19
19
|
import { Cause } from "@fncts/base/data/Cause/definition";
|
|
20
|
-
import { InterruptStatus } from "@fncts/io/InterruptStatus";
|
|
21
20
|
import { isInterruptedException, IllegalStateError } from "@fncts/base/data/exceptions";
|
|
22
21
|
import { FiberDescriptor } from "@fncts/io/FiberDescriptor";
|
|
22
|
+
import { InterruptStatus } from "@fncts/io/InterruptStatus";
|
|
23
23
|
import { LogLevel } from "@fncts/io/LogLevel";
|
|
24
24
|
import type { Instruction, Match } from "@fncts/io/IO/definition";
|
|
25
25
|
import { TraceElement } from "@fncts/base/data/TraceElement";
|
|
@@ -28,9 +28,9 @@ import { Stack } from "@fncts/base/internal/Stack";
|
|
|
28
28
|
import { FiberTypeId } from "@fncts/io/Fiber/definition";
|
|
29
29
|
import { FiberState } from "@fncts/io/FiberState";
|
|
30
30
|
import { FiberStatus } from "@fncts/io/FiberStatus";
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
export type FiberRefLocals = HashMap<FiberRef<unknown>, Cons<readonly [FiberId.Runtime, unknown]>>;
|
|
32
|
+
type Erased = IO<any, any, any>;
|
|
33
|
+
type ErasedCont = (a: any) => Erased;
|
|
34
34
|
export declare class InterruptExit {
|
|
35
35
|
readonly apply: ErasedCont;
|
|
36
36
|
readonly trace?: string | undefined;
|
|
@@ -56,7 +56,7 @@ export declare class Finalizer {
|
|
|
56
56
|
readonly _tag = "Finalizer";
|
|
57
57
|
constructor(finalizer: IO<any, never, any>, apply: ErasedCont, trace?: string | undefined);
|
|
58
58
|
}
|
|
59
|
-
export
|
|
59
|
+
export type Frame = InterruptExit | Match<any, any, any, any, any, any, any, any, any> | HandlerFrame | TracedCont | Finalizer;
|
|
60
60
|
export declare const currentFiber: AtomicReference<FiberContext<any, any> | null>;
|
|
61
61
|
export declare function unsafeCurrentFiber(): Maybe<FiberContext<any, any>>;
|
|
62
62
|
/**
|
|
@@ -65,10 +65,10 @@ export declare function unsafeCurrentFiber(): Maybe<FiberContext<any, any>>;
|
|
|
65
65
|
* @tsplus type fncts.io.Fiber
|
|
66
66
|
*/
|
|
67
67
|
export declare class FiberContext<E, A> implements Fiber.Runtime<E, A>, Hashable, Equatable {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
readonly fiberId: FiberId.Runtime;
|
|
69
|
+
runtimeConfig: RuntimeConfig;
|
|
70
|
+
interruptStatus: Stack<boolean>;
|
|
71
|
+
fiberRefLocals: FiberRefLocals;
|
|
72
72
|
private readonly _children;
|
|
73
73
|
readonly _typeId: FiberTypeId;
|
|
74
74
|
readonly _tag = "RuntimeFiber";
|
|
@@ -80,7 +80,6 @@ export declare class FiberContext<E, A> implements Fiber.Runtime<E, A>, Hashable
|
|
|
80
80
|
private asyncEpoch;
|
|
81
81
|
private stack;
|
|
82
82
|
nextIO: Instruction | null;
|
|
83
|
-
private currentSupervisor;
|
|
84
83
|
constructor(fiberId: FiberId.Runtime, runtimeConfig: RuntimeConfig, interruptStatus: Stack<boolean>, fiberRefLocals: FiberRefLocals, _children: Set<FiberContext<unknown, unknown>>);
|
|
85
84
|
get poll(): import("@fncts/io/IO/definition").UIO<import("@fncts/base/data/Maybe").Maybe<import("@fncts/base/data/Exit").Exit<E, A>>>;
|
|
86
85
|
get inheritRefs(): UIO<void>;
|
|
@@ -88,6 +87,7 @@ export declare class FiberContext<E, A> implements Fiber.Runtime<E, A>, Hashable
|
|
|
88
87
|
awaitAsync(k: FiberState.Callback<E, A>): void;
|
|
89
88
|
get children(): UIO<Conc<Fiber.Runtime<any, any>>>;
|
|
90
89
|
evalOnIO<R1, E1, B, R2, E2, C>(effect: IO<R1, E1, B>, orElse: IO<R2, E2, C>, __tsplusTrace?: string): IO<R1 & R2, E1 | E2, B | C>;
|
|
90
|
+
get fiberRefs(): FiberRefs;
|
|
91
91
|
get await(): UIO<Exit<E, A>>;
|
|
92
92
|
run(): void;
|
|
93
93
|
get scope(): FiberScope;
|
|
@@ -103,19 +103,19 @@ export declare class FiberContext<E, A> implements Fiber.Runtime<E, A>, Hashable
|
|
|
103
103
|
*/
|
|
104
104
|
runUntil(maxOpCount: number): void;
|
|
105
105
|
unsafeRunLater(i0: Instruction): void;
|
|
106
|
-
|
|
106
|
+
unsafeGetRef<A>(ref: FiberRef<A>): A;
|
|
107
107
|
private unsafeGetRefs;
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
unsafeSetRef<A>(ref: FiberRef<A>, value: A): void;
|
|
109
|
+
unsafeDeleteRef<A>(ref: FiberRef<A>): void;
|
|
110
110
|
unsafePoll(): import("@fncts/base/data/Maybe").Maybe<import("@fncts/base/data/Exit").Exit<E, A>>;
|
|
111
111
|
private interruptExit;
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
unsafeAddFinalizer(finalizer: IO<any, never, any>): void;
|
|
113
|
+
get unsafeIsInterruptible(): boolean;
|
|
114
114
|
private get unsafeIsInterrupted();
|
|
115
115
|
private get unsafeIsInterrupting();
|
|
116
116
|
private get unsafeShouldInterrupt();
|
|
117
117
|
private unsafeDisableInterruption;
|
|
118
|
-
|
|
118
|
+
unsafeRestoreInterruptStatus(): void;
|
|
119
119
|
private unsafeAddSuppressedCause;
|
|
120
120
|
/**
|
|
121
121
|
* Unwinds the stack, looking for the first error handler, and exiting
|
|
@@ -126,7 +126,7 @@ export declare class FiberContext<E, A> implements Fiber.Runtime<E, A>, Hashable
|
|
|
126
126
|
private unsafeNextEffect;
|
|
127
127
|
private unsafeNotifyObservers;
|
|
128
128
|
private unsafeRemoveObserver;
|
|
129
|
-
|
|
129
|
+
interruptAsFork(fiberId: FiberId): UIO<void>;
|
|
130
130
|
private unsafeTryDone;
|
|
131
131
|
private unsafeSetAsyncCanceller;
|
|
132
132
|
private unsafeReportUnhandled;
|
|
@@ -137,7 +137,7 @@ export declare class FiberContext<E, A> implements Fiber.Runtime<E, A>, Hashable
|
|
|
137
137
|
private unsafeFork;
|
|
138
138
|
unsafeOnDone(k: FiberState.Callback<never, Exit<E, A>>): void;
|
|
139
139
|
private unsafeClearSuppressedCause;
|
|
140
|
-
|
|
140
|
+
unsafeGetDescriptor(): import("../FiberDescriptor").FiberDescriptor;
|
|
141
141
|
private unsafeRace;
|
|
142
142
|
private unsafeCompleteRace;
|
|
143
143
|
private unsafeCaptureTrace;
|
|
@@ -146,5 +146,8 @@ export declare class FiberContext<E, A> implements Fiber.Runtime<E, A>, Hashable
|
|
|
146
146
|
unsafeAddChild(child: FiberContext<unknown, unknown>): void;
|
|
147
147
|
private unsafeLog;
|
|
148
148
|
private unsafeLogWith;
|
|
149
|
+
private unsafeIsFatal;
|
|
150
|
+
private unsafeHandleFatalError;
|
|
151
|
+
get currentSupervisor(): Supervisor<any>;
|
|
149
152
|
}
|
|
150
153
|
export {};
|
|
@@ -6,7 +6,7 @@ import { UIO } from "@fncts/io/IO/definition";
|
|
|
6
6
|
* @tsplus static fncts.io.FiberOps interruptAllAs
|
|
7
7
|
* @tsplus location "@fncts/io/Fiber/api/interruptAll"
|
|
8
8
|
*/
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function interruptAllAs(fs: Iterable<Fiber<any, any>>, id: FiberId, __tsplusTrace?: string): UIO<void>;
|
|
10
10
|
/**
|
|
11
11
|
* Interrupts all fibers and awaits their interruption
|
|
12
12
|
* @tsplus static fncts.io.FiberOps interruptAll
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Fiber } from "@fncts/io/Fiber/definition";
|
|
2
|
+
import { FiberId } from "@fncts/base/data/FiberId/definition";
|
|
3
|
+
import { UIO } from "@fncts/io/IO/definition";
|
|
4
|
+
/**
|
|
5
|
+
* @tsplus fluent fncts.io.Fiber interruptAsFork
|
|
6
|
+
* @tsplus location "@fncts/io/Fiber/api/interruptAsFork"
|
|
7
|
+
*/
|
|
8
|
+
export declare function interruptAsFork<E, A>(self: Fiber<E, A>, fiberId: FiberId): UIO<void>;
|
package/Fiber/definition.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { TraceElement } from "@fncts/base/data/TraceElement/definition";
|
|
|
7
7
|
import { Trace } from "@fncts/base/data/Trace/definition";
|
|
8
8
|
import type { FiberStatus } from "@fncts/io/FiberStatus";
|
|
9
9
|
export declare const FiberTypeId: unique symbol;
|
|
10
|
-
export
|
|
10
|
+
export type FiberTypeId = typeof FiberTypeId;
|
|
11
11
|
/**
|
|
12
12
|
* @tsplus type fncts.io.Fiber
|
|
13
13
|
*/
|
|
@@ -39,11 +39,9 @@ export interface FiberCommon<E, A> extends Fiber<E, A> {
|
|
|
39
39
|
*/
|
|
40
40
|
readonly inheritRefs: UIO<void>;
|
|
41
41
|
/**
|
|
42
|
-
* Interrupts the fiber as if interrupted from the specified fiber.
|
|
43
|
-
* fiber has already exited, the returned effect will resume immediately.
|
|
44
|
-
* Otherwise, the effect will resume when the fiber exits.
|
|
42
|
+
* Interrupts the fiber as if interrupted from the specified fiber.
|
|
45
43
|
*/
|
|
46
|
-
readonly
|
|
44
|
+
readonly interruptAsFork: (fiberId: FiberId) => UIO<void>;
|
|
47
45
|
/**
|
|
48
46
|
* Tentatively observes the fiber, but returns immediately if it is not already done.
|
|
49
47
|
*/
|
|
@@ -84,15 +82,15 @@ export declare class SyntheticFiber<E, A> implements FiberCommon<E, A> {
|
|
|
84
82
|
readonly children: UIO<Conc<Fiber.Runtime<any, any>>>;
|
|
85
83
|
readonly inheritRefs: UIO<void>;
|
|
86
84
|
readonly poll: UIO<Maybe<Exit<E, A>>>;
|
|
87
|
-
readonly
|
|
85
|
+
readonly interruptAsFork: (fiberId: FiberId) => UIO<void>;
|
|
88
86
|
readonly _tag = "SyntheticFiber";
|
|
89
87
|
readonly _typeId: FiberTypeId;
|
|
90
88
|
readonly _E: () => E;
|
|
91
89
|
readonly _A: () => A;
|
|
92
90
|
readonly await: import("../IO").UIO<import("@fncts/base/data/Exit").Exit<E, A>>;
|
|
93
|
-
constructor(id: FiberId, wait: UIO<Exit<E, A>>, children: UIO<Conc<Fiber.Runtime<any, any>>>, inheritRefs: UIO<void>, poll: UIO<Maybe<Exit<E, A>>>,
|
|
91
|
+
constructor(id: FiberId, wait: UIO<Exit<E, A>>, children: UIO<Conc<Fiber.Runtime<any, any>>>, inheritRefs: UIO<void>, poll: UIO<Maybe<Exit<E, A>>>, interruptAsFork: (fiberId: FiberId) => UIO<void>);
|
|
94
92
|
}
|
|
95
|
-
export
|
|
93
|
+
export type ConcreteFiber<E, A> = Fiber.Runtime<E, A> | Fiber.Synthetic<E, A>;
|
|
96
94
|
/**
|
|
97
95
|
* @tsplus fluent fncts.io.Fiber concrete
|
|
98
96
|
* @tsplus macro remove
|
package/FiberRef/api.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare function getAndUpdateJust_<A>(fiberRef: FiberRef<A>, f: (a: A) =>
|
|
|
43
43
|
* @tsplus fluent fncts.io.FiberRef locally
|
|
44
44
|
* @tsplus location "@fncts/io/FiberRef/api"
|
|
45
45
|
*/
|
|
46
|
-
export declare function locally_<A>(fiberRef: FiberRef<A>, value: A, __tsplusTrace?: string): <R1, E1, B>(use: import("
|
|
46
|
+
export declare function locally_<A>(fiberRef: FiberRef<A>, value: A, __tsplusTrace?: string): <R1, E1, B>(use: import("../IO").IO<R1, E1, B>) => import("../IO").IO<R1, E1, B>;
|
|
47
47
|
/**
|
|
48
48
|
* Returns an `IO` that runs with `f` applied to the current fiber.
|
|
49
49
|
*
|
|
@@ -51,7 +51,7 @@ export declare function locally_<A>(fiberRef: FiberRef<A>, value: A, __tsplusTra
|
|
|
51
51
|
* @tsplus fluent fncts.io.FiberRef locallyWith
|
|
52
52
|
* @tsplus location "@fncts/io/FiberRef/api"
|
|
53
53
|
*/
|
|
54
|
-
export declare function locallyWith_<A>(self: FiberRef<A>, f: (a: A) => A, __tsplusTrace?: string): <R1, E1, B>(use: import("
|
|
54
|
+
export declare function locallyWith_<A>(self: FiberRef<A>, f: (a: A) => A, __tsplusTrace?: string): <R1, E1, B>(use: import("../IO").IO<R1, E1, B>) => import("../IO").IO<R1, E1, B>;
|
|
55
55
|
/**
|
|
56
56
|
* @tsplus fluent fncts.io.FiberRef getWith
|
|
57
57
|
* @tsplus location "@fncts/io/FiberRef/api"
|
|
@@ -87,3 +87,8 @@ export declare function patch<Value, Patch>(self: FiberRef.WithPatch<Value, Patc
|
|
|
87
87
|
* @tsplus location "@fncts/io/FiberRef/api"
|
|
88
88
|
*/
|
|
89
89
|
export declare function fork<Value, Patch>(self: FiberRef.WithPatch<Value, Patch>): Patch;
|
|
90
|
+
/**
|
|
91
|
+
* @tsplus fluent fncts.io.FiberRef join
|
|
92
|
+
* @tsplus location "@fncts/io/FiberRef/api"
|
|
93
|
+
*/
|
|
94
|
+
export declare function join<Value, Patch>(self: FiberRef.WithPatch<Value, Patch>, oldValue: Value, newValue: Value): Value;
|
package/FiberRef/definition.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hashable } from "@fncts/base/typeclass/Hashable";
|
|
2
2
|
import { Equatable } from "@fncts/base/typeclass/Equatable";
|
|
3
3
|
export declare const FiberRefTypeId: unique symbol;
|
|
4
|
-
export
|
|
4
|
+
export type FiberRefTypeId = typeof FiberRefTypeId;
|
|
5
5
|
/**
|
|
6
6
|
* @tsplus type fncts.io.FiberRef
|
|
7
7
|
* @tsplus companion fncts.io.FiberRefOps
|
|
@@ -25,14 +25,15 @@ export declare class FiberRefInternal<Value, Patch> extends FiberRef<Value> impl
|
|
|
25
25
|
readonly _combine: (first: Patch, second: Patch) => Patch;
|
|
26
26
|
readonly _patch: (patch: Patch) => (oldValue: Value) => Value;
|
|
27
27
|
readonly _fork: Patch;
|
|
28
|
+
readonly _join: (oldValue: Value, newValue: Value) => Value;
|
|
28
29
|
readonly _Patch: Patch;
|
|
29
30
|
private readonly id;
|
|
30
|
-
constructor(_initial: Value, _diff: (oldValue: Value, newValue: Value) => Patch, _combine: (first: Patch, second: Patch) => Patch, _patch: (patch: Patch) => (oldValue: Value) => Value, _fork: Patch);
|
|
31
|
+
constructor(_initial: Value, _diff: (oldValue: Value, newValue: Value) => Patch, _combine: (first: Patch, second: Patch) => Patch, _patch: (patch: Patch) => (oldValue: Value) => Value, _fork: Patch, _join: (oldValue: Value, newValue: Value) => Value);
|
|
31
32
|
get [Symbol.hash](): number;
|
|
32
33
|
[Symbol.equals](that: unknown): boolean;
|
|
33
34
|
}
|
|
34
35
|
export declare function isFiberRef(u: unknown): u is FiberRef<unknown>;
|
|
35
|
-
|
|
36
|
+
type Concrete<Value, Patch> = FiberRefInternal<Value, Patch>;
|
|
36
37
|
/**
|
|
37
38
|
* @tsplus macro remove
|
|
38
39
|
*/
|
package/FiberRef/unsafe.d.ts
CHANGED
|
@@ -5,14 +5,16 @@ import { FiberScope } from "@fncts/io/FiberScope";
|
|
|
5
5
|
import { LogLevel } from "@fncts/io/LogLevel";
|
|
6
6
|
import { List } from "@fncts/base/collection/immutable/List/definition";
|
|
7
7
|
import { HashMap } from "@fncts/base/collection/immutable/HashMap/definition";
|
|
8
|
+
import { Supervisor } from "@fncts/io/Supervisor/definition";
|
|
8
9
|
import type { LogSpan } from "../LogSpan.js";
|
|
9
10
|
import type { Scheduler } from "@fncts/io/internal/Scheduler.js";
|
|
10
11
|
import { Patch } from "@fncts/base/data/Patch";
|
|
12
|
+
import { IsFatal } from "../internal/IsFatal.js";
|
|
11
13
|
/**
|
|
12
14
|
* @tsplus static fncts.io.FiberRefOps unsafeMakePatch
|
|
13
15
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
|
14
16
|
*/
|
|
15
|
-
export declare function unsafeMakePatch<Value, Patch>(initial: Value, diff: (oldValue: Value, newValue: Value) => Patch, combine: (first: Patch, second: Patch) => Patch, patch: (patch: Patch) => (oldValue: Value) => Value, fork: Patch): FiberRef.WithPatch<Value, Patch>;
|
|
17
|
+
export declare function unsafeMakePatch<Value, Patch>(initial: Value, diff: (oldValue: Value, newValue: Value) => Patch, combine: (first: Patch, second: Patch) => Patch, patch: (patch: Patch) => (oldValue: Value) => Value, fork: Patch, join?: (oldValue: Value, newValue: Value) => Value): FiberRef.WithPatch<Value, Patch>;
|
|
16
18
|
/**
|
|
17
19
|
* @tsplus static fncts.io.FiberRefOps unsafeMakeEnvironment
|
|
18
20
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
|
@@ -58,3 +60,18 @@ export declare const currentLogAnnotations: import("./definition.js").FiberRef.W
|
|
|
58
60
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
|
59
61
|
*/
|
|
60
62
|
export declare const currentScheduler: import("./definition.js").FiberRef.WithPatch<Scheduler, (_: Scheduler) => Scheduler>;
|
|
63
|
+
/**
|
|
64
|
+
* @tsplus static fncts.io.FiberRefOps currentSupervisor
|
|
65
|
+
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
|
66
|
+
*/
|
|
67
|
+
export declare const currentSupervisor: import("./definition.js").FiberRef.WithPatch<import("../Supervisor.js").Supervisor<any>, (_: import("../Supervisor.js").Supervisor<any>) => import("../Supervisor.js").Supervisor<any>>;
|
|
68
|
+
/**
|
|
69
|
+
* @tsplus static fncts.io.FiberRefOps currentIsFatal
|
|
70
|
+
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
|
71
|
+
*/
|
|
72
|
+
export declare const currentIsFatal: import("./definition.js").FiberRef.WithPatch<IsFatal, (_: IsFatal) => IsFatal>;
|
|
73
|
+
/**
|
|
74
|
+
* @tsplus static fncts.io.FiberRefOps currentReportFatal
|
|
75
|
+
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
|
76
|
+
*/
|
|
77
|
+
export declare const currentReportFatal: import("./definition.js").FiberRef.WithPatch<(t: unknown) => never, (_: (t: unknown) => never) => (t: unknown) => never>;
|
package/FiberRefs/api.d.ts
CHANGED
|
@@ -14,3 +14,8 @@ export declare function fiberRefs(self: FiberRefs): HashSet<FiberRef<unknown>>;
|
|
|
14
14
|
* @tsplus location "@fncts/io/FiberRefs/api"
|
|
15
15
|
*/
|
|
16
16
|
export declare function make(fiberRefLocals: HashMap<FiberRef<unknown>, Cons<readonly [FiberId.Runtime, unknown]>>): FiberRefs;
|
|
17
|
+
/**
|
|
18
|
+
* @tsplus fluent fncts.io.FiberRefs forkAs
|
|
19
|
+
* @tsplus location "@fncts/io/FiberRefs/api"
|
|
20
|
+
*/
|
|
21
|
+
export declare function forkAs(self: FiberRefs, childId: FiberId.Runtime): FiberRefs;
|
|
@@ -3,7 +3,7 @@ import { FiberRef } from "@fncts/io/FiberRef/definition";
|
|
|
3
3
|
import { Cons } from "@fncts/base/collection/immutable/List/definition";
|
|
4
4
|
import { FiberId } from "@fncts/base/data/FiberId/definition";
|
|
5
5
|
export declare const FiberRefsTypeId: unique symbol;
|
|
6
|
-
export
|
|
6
|
+
export type FiberRefsTypeId = typeof FiberRefsTypeId;
|
|
7
7
|
/**
|
|
8
8
|
* @tsplus type fncts.io.FiberRefs
|
|
9
9
|
* @tsplus companion fncts.io.FiberRefsOps
|
|
@@ -7,7 +7,7 @@ import { FiberStatus } from "../FiberStatus.js";
|
|
|
7
7
|
/**
|
|
8
8
|
* @tsplus type fncts.FiberState
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type FiberState<E, A> = Executing<E, A> | Done<E, A>;
|
|
11
11
|
/**
|
|
12
12
|
* @tsplus type fncts.FiberStateOps
|
|
13
13
|
*/
|
|
@@ -17,7 +17,7 @@ export declare const FiberState: FiberStateOps;
|
|
|
17
17
|
export declare namespace FiberState {
|
|
18
18
|
type Callback<E, A> = (exit: Exit<E, A>) => void;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export type Callback<E, A> = (exit: Exit<E, A>) => void;
|
|
21
21
|
export declare class Executing<E, A> {
|
|
22
22
|
status: FiberStatus;
|
|
23
23
|
observers: Set<Callback<never, Exit<E, A>>>;
|
|
@@ -50,7 +50,7 @@ export declare class Suspended {
|
|
|
50
50
|
/**
|
|
51
51
|
* @tsplus type fncts.FiberStatus
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type FiberStatus = Done | Finishing | Running | Suspended;
|
|
54
54
|
/**
|
|
55
55
|
* @tsplus type fncts.FiberStatusOps
|
|
56
56
|
*/
|
package/Future/definition.d.ts
CHANGED
package/Hub/definition.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { PQueue } from "@fncts/io/Queue/definition";
|
|
|
2
2
|
import { UIO, IO } from "@fncts/io/IO/definition";
|
|
3
3
|
import { Scope } from "@fncts/io/Scope/definition";
|
|
4
4
|
export declare const HubTypeId: unique symbol;
|
|
5
|
-
export
|
|
5
|
+
export type HubTypeId = typeof HubTypeId;
|
|
6
6
|
/**
|
|
7
7
|
* A `Hub<RA, RB, EA, EB, A, B>` is an asynchronous message hub. Publishers
|
|
8
8
|
* can publish messages of type `A` to the hub and subscribers can subscribe to
|
package/IO/api/core-scope.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { UIO, URIO } from "@fncts/io/IO/definition";
|
|
2
|
+
import { FiberRef } from "@fncts/io/FiberRef/definition";
|
|
2
3
|
import { Just } from "@fncts/base/data/Maybe/definition";
|
|
3
4
|
import { Lazy } from "@fncts/base/data/function/definition";
|
|
4
5
|
import { Exit } from "@fncts/base/data/Exit/definition";
|
|
5
6
|
import { Fiber } from "@fncts/io/Fiber/definition";
|
|
6
7
|
import { FiberScope } from "../../FiberScope.js";
|
|
7
|
-
import {
|
|
8
|
+
import { IO } from "../definition.js";
|
|
8
9
|
/**
|
|
9
10
|
* @tsplus getter fncts.io.IO daemonChildren
|
|
10
11
|
* @tsplus location "@fncts/io/IO/api/core-scope"
|
|
@@ -21,7 +22,7 @@ export declare const forkScope: UIO<FiberScope>;
|
|
|
21
22
|
* @tsplus static fncts.io.IOOps forkScopeWith
|
|
22
23
|
* @tsplus location "@fncts/io/IO/api/core-scope"
|
|
23
24
|
*/
|
|
24
|
-
export declare function forkScopeWith<R, E, A>(f: (_: FiberScope) => IO<R, E, A>, __tsplusTrace?: string):
|
|
25
|
+
export declare function forkScopeWith<R, E, A>(f: (_: FiberScope) => IO<R, E, A>, __tsplusTrace?: string): IO<R, E, A>;
|
|
25
26
|
export declare class ForkScopeRestore {
|
|
26
27
|
private scope;
|
|
27
28
|
constructor(scope: FiberScope);
|
|
@@ -42,7 +43,7 @@ export declare function forkScopeMask_<R, E, A>(newScope: FiberScope, f: (restor
|
|
|
42
43
|
* @tsplus location "@fncts/io/IO/api/core-scope"
|
|
43
44
|
*/
|
|
44
45
|
export declare function raceWith_<R, E, A, R1, E1, A1, R2, E2, A2, R3, E3, A3>(left: IO<R, E, A>, right: Lazy<IO<R1, E1, A1>>, leftWins: (exit: Exit<E, A>, fiber: Fiber<E1, A1>) => IO<R2, E2, A2>, rightWins: (exit: Exit<E1, A1>, fiber: Fiber<E, A>) => IO<R3, E3, A3>, __tsplusTrace?: string): IO<R | R1 | R2 | R3, E2 | E3, A2 | A3>;
|
|
45
|
-
export
|
|
46
|
+
export type Grafter = <R, E, A>(effect: IO<R, E, A>) => IO<R, E, A>;
|
|
46
47
|
/**
|
|
47
48
|
* Transplants specified effects so that when those effects fork other
|
|
48
49
|
* effects, the forked effects will be governed by the scope of the
|
package/IO/api/interrupt.d.ts
CHANGED
|
@@ -104,6 +104,6 @@ export declare function disconnect<R, E, A>(self: IO<R, E, A>, __tsplusTrace?: s
|
|
|
104
104
|
export declare class InterruptStatusRestore {
|
|
105
105
|
readonly flag: InterruptStatus;
|
|
106
106
|
constructor(flag: InterruptStatus);
|
|
107
|
-
restore: <R, E, A>(io: import("../definition
|
|
108
|
-
force: <R, E, A>(io: import("../definition
|
|
107
|
+
restore: <R, E, A>(io: import("../definition").IO<R, E, A>) => import("../definition").IO<R, E, A>;
|
|
108
|
+
force: <R, E, A>(io: import("../definition").IO<R, E, A>) => import("../definition").IO<R, E, A>;
|
|
109
109
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IO } from "@fncts/io/IO/definition";
|
|
2
|
+
import { Supervisor } from "@fncts/io/Supervisor/definition";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* Returns an IO with the behavior of this one, but where all child
|
|
6
|
+
* fibers forked in the effect are reported to the specified supervisor.
|
|
7
|
+
* @tsplus fluent fncts.io.IO supervised
|
|
8
|
+
* @tsplus location "@fncts/io/IO/api/supervised"
|
|
9
|
+
*/
|
|
10
|
+
export declare function supervised_<R, E, A>(fa: IO<R, E, A>, supervisor: Supervisor<any>, __tsplusTrace?: string): IO<R, E, A>;
|
package/IO/api.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ import { Exit } from "@fncts/base/data/Exit/definition";
|
|
|
16
16
|
import { Trace } from "@fncts/base/data/Trace/definition";
|
|
17
17
|
import { List } from "@fncts/base/collection/immutable/List/definition";
|
|
18
18
|
import { ImmutableArray } from "@fncts/base/collection/immutable/ImmutableArray/definition";
|
|
19
|
-
import { Supervisor } from "@fncts/io/Supervisor/definition";
|
|
20
19
|
import { FiberRefs } from "@fncts/io/FiberRefs";
|
|
20
|
+
import type { FiberStatus } from "../FiberStatus.js";
|
|
21
21
|
import type * as P from "@fncts/base/typeclass";
|
|
22
22
|
import type { _E, _R } from "@fncts/base/types";
|
|
23
23
|
import type { FiberContext } from "@fncts/io/Fiber/FiberContext";
|
|
@@ -271,7 +271,7 @@ export declare function deferTryCatchWith<R, E, A, E1>(io: (runtimeConfig: Runti
|
|
|
271
271
|
* @tsplus static fncts.io.IOOps descriptor
|
|
272
272
|
* @tsplus location "@fncts/io/IO/api"
|
|
273
273
|
*/
|
|
274
|
-
export declare const descriptor: IO<never, never, import("../FiberDescriptor").FiberDescriptor>;
|
|
274
|
+
export declare const descriptor: IO<never, never, import("../FiberDescriptor.js").FiberDescriptor>;
|
|
275
275
|
/**
|
|
276
276
|
* Constructs an IO based on information about the current fiber, such as
|
|
277
277
|
* its identity.
|
|
@@ -972,14 +972,6 @@ export declare function succeedNow<A>(value: A, __tsplusTrace?: string): IO<neve
|
|
|
972
972
|
* @tsplus location "@fncts/io/IO/api"
|
|
973
973
|
*/
|
|
974
974
|
export declare function succeed<A>(effect: Lazy<A>, __tsplusTrace?: string): UIO<A>;
|
|
975
|
-
/**
|
|
976
|
-
*
|
|
977
|
-
* Returns an IO with the behavior of this one, but where all child
|
|
978
|
-
* fibers forked in the effect are reported to the specified supervisor.
|
|
979
|
-
* @tsplus fluent fncts.io.IO supervised
|
|
980
|
-
* @tsplus location "@fncts/io/IO/api"
|
|
981
|
-
*/
|
|
982
|
-
export declare function supervised_<R, E, A>(fa: IO<R, E, A>, supervisor: Supervisor<any>, __tsplusTrace?: string): IO<R, E, A>;
|
|
983
975
|
/**
|
|
984
976
|
* @tsplus fluent fncts.io.IO summarized
|
|
985
977
|
* @tsplus location "@fncts/io/IO/api"
|
|
@@ -1080,6 +1072,11 @@ export declare function unsandbox<R, E, A>(ma: IO<R, Cause<E>, A>, __tsplusTrace
|
|
|
1080
1072
|
* @tsplus location "@fncts/io/IO/api"
|
|
1081
1073
|
*/
|
|
1082
1074
|
export declare function updateFiberRefs(f: (fiberId: FiberId.Runtime, fiberRefs: FiberRefs) => FiberRefs, __tsplusTrace?: string): UIO<void>;
|
|
1075
|
+
/**
|
|
1076
|
+
* @tsplus static fncts.io.IOOps withFiberContext
|
|
1077
|
+
* @tsplus location "@fncts/io/IO/api"
|
|
1078
|
+
*/
|
|
1079
|
+
export declare function withFiberContext<R, E, A>(onState: (fiber: FiberContext<E, A>, status: FiberStatus) => IO<R, E, A>, __tsplusTrace?: string): IO<R, E, A>;
|
|
1083
1080
|
/**
|
|
1084
1081
|
* @tsplus fluent fncts.io.IO __call
|
|
1085
1082
|
* @tsplus location "@fncts/io/IO/api"
|