@fncts/io 0.0.15 → 0.0.18
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/Fiber/FiberContext.d.ts +18 -18
- package/Fiber/definition.d.ts +2 -2
- package/FiberRef/api.d.ts +2 -2
- package/FiberRef/definition.d.ts +2 -2
- package/FiberRef/unsafe.d.ts +6 -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/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 +1 -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 +161 -294
- package/_cjs/Fiber/FiberContext.cjs.map +1 -1
- package/_cjs/FiberRef/api.cjs +19 -10
- package/_cjs/FiberRef/api.cjs.map +1 -1
- package/_cjs/FiberRef/unsafe.cjs +9 -1
- package/_cjs/FiberRef/unsafe.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 +17 -9
- 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.cjs +69 -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.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/Scope/definition.cjs +1 -1
- package/_cjs/Scope/definition.cjs.map +1 -1
- package/_mjs/Clock/definition.mjs +1 -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 +161 -293
- package/_mjs/Fiber/FiberContext.mjs.map +1 -1
- package/_mjs/FiberRef/api.mjs +18 -9
- package/_mjs/FiberRef/api.mjs.map +1 -1
- package/_mjs/FiberRef/unsafe.mjs +6 -0
- package/_mjs/FiberRef/unsafe.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 +14 -6
- 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.mjs +67 -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.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/Scope/definition.mjs +1 -1
- package/_mjs/Scope/definition.mjs.map +1 -1
- package/_src/Clock/definition.ts +1 -1
- package/_src/Console/definition.ts +1 -1
- package/_src/Fiber/FiberContext.ts +21 -111
- package/_src/FiberRef/api.ts +15 -7
- package/_src/FiberRef/unsafe.ts +5 -0
- 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.ts +1 -0
- package/_src/Layer/api.ts +1 -1
- package/_src/Random/definition.ts +1 -1
- package/_src/Scope/definition.ts +1 -1
- package/package.json +4 -3
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/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 = AtomicReference<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>;
|
@@ -103,19 +102,19 @@ export declare class FiberContext<E, A> implements Fiber.Runtime<E, A>, Hashable
|
|
103
102
|
*/
|
104
103
|
runUntil(maxOpCount: number): void;
|
105
104
|
unsafeRunLater(i0: Instruction): void;
|
106
|
-
|
105
|
+
unsafeGetRef<A>(ref: FiberRef<A>): A;
|
107
106
|
private unsafeGetRefs;
|
108
|
-
|
109
|
-
|
107
|
+
unsafeSetRef<A>(ref: FiberRef<A>, value: A): void;
|
108
|
+
unsafeDeleteRef<A>(ref: FiberRef<A>): void;
|
110
109
|
unsafePoll(): import("@fncts/base/data/Maybe").Maybe<import("@fncts/base/data/Exit").Exit<E, A>>;
|
111
110
|
private interruptExit;
|
112
|
-
|
113
|
-
|
111
|
+
unsafeAddFinalizer(finalizer: IO<any, never, any>): void;
|
112
|
+
get unsafeIsInterruptible(): boolean;
|
114
113
|
private get unsafeIsInterrupted();
|
115
114
|
private get unsafeIsInterrupting();
|
116
115
|
private get unsafeShouldInterrupt();
|
117
116
|
private unsafeDisableInterruption;
|
118
|
-
|
117
|
+
unsafeRestoreInterruptStatus(): void;
|
119
118
|
private unsafeAddSuppressedCause;
|
120
119
|
/**
|
121
120
|
* Unwinds the stack, looking for the first error handler, and exiting
|
@@ -137,7 +136,7 @@ export declare class FiberContext<E, A> implements Fiber.Runtime<E, A>, Hashable
|
|
137
136
|
private unsafeFork;
|
138
137
|
unsafeOnDone(k: FiberState.Callback<never, Exit<E, A>>): void;
|
139
138
|
private unsafeClearSuppressedCause;
|
140
|
-
|
139
|
+
unsafeGetDescriptor(): import("../FiberDescriptor").FiberDescriptor;
|
141
140
|
private unsafeRace;
|
142
141
|
private unsafeCompleteRace;
|
143
142
|
private unsafeCaptureTrace;
|
@@ -146,5 +145,6 @@ export declare class FiberContext<E, A> implements Fiber.Runtime<E, A>, Hashable
|
|
146
145
|
unsafeAddChild(child: FiberContext<unknown, unknown>): void;
|
147
146
|
private unsafeLog;
|
148
147
|
private unsafeLogWith;
|
148
|
+
get currentSupervisor(): Supervisor<any>;
|
149
149
|
}
|
150
150
|
export {};
|
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
|
*/
|
@@ -92,7 +92,7 @@ export declare class SyntheticFiber<E, A> implements FiberCommon<E, A> {
|
|
92
92
|
readonly await: import("../IO").UIO<import("@fncts/base/data/Exit").Exit<E, A>>;
|
93
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>>>, interruptAs: (fiberId: FiberId) => UIO<Exit<E, A>>);
|
94
94
|
}
|
95
|
-
export
|
95
|
+
export type ConcreteFiber<E, A> = Fiber.Runtime<E, A> | Fiber.Synthetic<E, A>;
|
96
96
|
/**
|
97
97
|
* @tsplus fluent fncts.io.Fiber concrete
|
98
98
|
* @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"
|
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
|
@@ -32,7 +32,7 @@ export declare class FiberRefInternal<Value, Patch> extends FiberRef<Value> impl
|
|
32
32
|
[Symbol.equals](that: unknown): boolean;
|
33
33
|
}
|
34
34
|
export declare function isFiberRef(u: unknown): u is FiberRef<unknown>;
|
35
|
-
|
35
|
+
type Concrete<Value, Patch> = FiberRefInternal<Value, Patch>;
|
36
36
|
/**
|
37
37
|
* @tsplus macro remove
|
38
38
|
*/
|
package/FiberRef/unsafe.d.ts
CHANGED
@@ -5,6 +5,7 @@ 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";
|
@@ -58,3 +59,8 @@ export declare const currentLogAnnotations: import("./definition.js").FiberRef.W
|
|
58
59
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
59
60
|
*/
|
60
61
|
export declare const currentScheduler: import("./definition.js").FiberRef.WithPatch<Scheduler, (_: Scheduler) => Scheduler>;
|
62
|
+
/**
|
63
|
+
* @tsplus static fncts.io.FiberRefOps currentSupervisor
|
64
|
+
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
65
|
+
*/
|
66
|
+
export declare const currentSupervisor: import("./definition.js").FiberRef.WithPatch<import("../Supervisor.js").Supervisor<any>, (_: import("../Supervisor.js").Supervisor<any>) => import("../Supervisor.js").Supervisor<any>>;
|
@@ -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"
|