@fncts/io 0.0.34 → 0.0.36
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/Fiber/FiberRuntime.d.ts +7 -7
- package/Fiber/constructors.d.ts +5 -0
- package/IO/api/all.d.ts +41 -0
- package/IO/api/concurrency.d.ts +11 -0
- package/IO/api/interrupt.d.ts +1 -1
- package/IO/api/raceWith.d.ts +2 -1
- package/IO/api.d.ts +7 -2
- package/IO/definition.d.ts +103 -127
- package/IO.d.ts +1 -0
- package/Push/api.d.ts +86 -36
- package/Push/definition.d.ts +28 -13
- package/Push/internal.d.ts +7 -11
- package/RefSubject/Atomic.d.ts +8 -11
- package/RefSubject/Synchronized/definition.d.ts +4 -6
- package/RefSubject/api.d.ts +0 -1
- package/RefSubject/definition.d.ts +6 -8
- package/STM/definition.d.ts +19 -2
- package/Sink/api.d.ts +24 -24
- package/Subject/Atomic.d.ts +4 -6
- package/Subject/definition.d.ts +2 -2
- package/_cjs/Channel/api/runScoped.cjs +1 -1
- package/_cjs/Channel/api/runScoped.cjs.map +1 -1
- package/_cjs/Channel/api.cjs +2 -2
- package/_cjs/Channel/api.cjs.map +1 -1
- package/_cjs/Fiber/FiberRuntime.cjs +110 -98
- package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
- package/_cjs/Fiber/constructors.cjs +10 -2
- package/_cjs/Fiber/constructors.cjs.map +1 -1
- package/_cjs/Future/api.cjs +1 -1
- package/_cjs/Future/api.cjs.map +1 -1
- package/_cjs/IO/api/all.cjs +33 -0
- package/_cjs/IO/api/all.cjs.map +1 -0
- package/_cjs/IO/api/asyncIO.cjs +1 -1
- package/_cjs/IO/api/asyncIO.cjs.map +1 -1
- package/_cjs/IO/api/bracketExit.cjs +1 -1
- package/_cjs/IO/api/bracketExit.cjs.map +1 -1
- package/_cjs/IO/api/concurrency.cjs +25 -4
- package/_cjs/IO/api/concurrency.cjs.map +1 -1
- package/_cjs/IO/api/disconnect.cjs +1 -1
- package/_cjs/IO/api/disconnect.cjs.map +1 -1
- package/_cjs/IO/api/foreachConcurrent.cjs +1 -1
- package/_cjs/IO/api/foreachConcurrent.cjs.map +1 -1
- package/_cjs/IO/api/foreachExec.cjs +1 -1
- package/_cjs/IO/api/foreachExec.cjs.map +1 -1
- package/_cjs/IO/api/forkIn.cjs +1 -1
- package/_cjs/IO/api/forkIn.cjs.map +1 -1
- package/_cjs/IO/api/forkScoped.cjs +1 -1
- package/_cjs/IO/api/forkScoped.cjs.map +1 -1
- package/_cjs/IO/api/fulfill.cjs +1 -1
- package/_cjs/IO/api/fulfill.cjs.map +1 -1
- package/_cjs/IO/api/interrupt.cjs +18 -6
- package/_cjs/IO/api/interrupt.cjs.map +1 -1
- package/_cjs/IO/api/raceWith.cjs +4 -4
- package/_cjs/IO/api/raceWith.cjs.map +1 -1
- package/_cjs/IO/api/timeout.cjs +8 -5
- package/_cjs/IO/api/timeout.cjs.map +1 -1
- package/_cjs/IO/api/zipConcurrent.cjs +1 -1
- package/_cjs/IO/api/zipConcurrent.cjs.map +1 -1
- package/_cjs/IO/api.cjs +78 -20
- package/_cjs/IO/api.cjs.map +1 -1
- package/_cjs/IO/definition.cjs +14 -191
- package/_cjs/IO/definition.cjs.map +1 -1
- package/_cjs/IO.cjs +11 -0
- package/_cjs/IO.cjs.map +1 -1
- package/_cjs/Layer/MemoMap.cjs +1 -1
- package/_cjs/Layer/MemoMap.cjs.map +1 -1
- package/_cjs/Layer/api.cjs.map +1 -1
- package/_cjs/Push/api.cjs +238 -168
- package/_cjs/Push/api.cjs.map +1 -1
- package/_cjs/Push/definition.cjs +12 -13
- package/_cjs/Push/definition.cjs.map +1 -1
- package/_cjs/Push/internal.cjs +37 -29
- package/_cjs/Push/internal.cjs.map +1 -1
- package/_cjs/RefSubject/Atomic.cjs +15 -19
- package/_cjs/RefSubject/Atomic.cjs.map +1 -1
- package/_cjs/RefSubject/Synchronized/definition.cjs +9 -10
- package/_cjs/RefSubject/Synchronized/definition.cjs.map +1 -1
- package/_cjs/RefSubject/api.cjs +5 -6
- package/_cjs/RefSubject/api.cjs.map +1 -1
- package/_cjs/RefSubject/definition.cjs.map +1 -1
- package/_cjs/STM/api/atomically.cjs +1 -1
- package/_cjs/STM/api/atomically.cjs.map +1 -1
- package/_cjs/STM/api.cjs +2 -2
- package/_cjs/STM/api.cjs.map +1 -1
- package/_cjs/STM/definition.cjs +1 -1
- package/_cjs/STM/definition.cjs.map +1 -1
- package/_cjs/ScopedRef/api.cjs +2 -2
- package/_cjs/ScopedRef/api.cjs.map +1 -1
- package/_cjs/Semaphore.cjs +1 -1
- package/_cjs/Semaphore.cjs.map +1 -1
- package/_cjs/Sink/api.cjs +13 -13
- package/_cjs/Sink/api.cjs.map +1 -1
- package/_cjs/Subject/Atomic.cjs +4 -5
- package/_cjs/Subject/Atomic.cjs.map +1 -1
- package/_cjs/TReentrantLock/api.cjs +2 -2
- package/_cjs/TReentrantLock/api.cjs.map +1 -1
- package/_cjs/TSemaphore/api.cjs +1 -1
- package/_cjs/TSemaphore/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +12 -17
- package/_cjs/collection/immutable/Conc/dropUntilIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +12 -17
- package/_cjs/collection/immutable/Conc/dropWhileIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/filterIO.cjs +2 -12
- package/_cjs/collection/immutable/Conc/filterIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/mapIO.cjs +3 -9
- package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +11 -27
- package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -1
- package/_mjs/Channel/api/runScoped.mjs +1 -1
- package/_mjs/Channel/api/runScoped.mjs.map +1 -1
- package/_mjs/Channel/api.mjs +2 -2
- package/_mjs/Channel/api.mjs.map +1 -1
- package/_mjs/Fiber/FiberRuntime.mjs +111 -100
- package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
- package/_mjs/Fiber/constructors.mjs +7 -1
- package/_mjs/Fiber/constructors.mjs.map +1 -1
- package/_mjs/Future/api.mjs +1 -1
- package/_mjs/Future/api.mjs.map +1 -1
- package/_mjs/IO/api/all.mjs +24 -0
- package/_mjs/IO/api/all.mjs.map +1 -0
- package/_mjs/IO/api/asyncIO.mjs +1 -1
- package/_mjs/IO/api/asyncIO.mjs.map +1 -1
- package/_mjs/IO/api/bracketExit.mjs +1 -1
- package/_mjs/IO/api/bracketExit.mjs.map +1 -1
- package/_mjs/IO/api/concurrency.mjs +19 -2
- package/_mjs/IO/api/concurrency.mjs.map +1 -1
- package/_mjs/IO/api/disconnect.mjs +1 -1
- package/_mjs/IO/api/disconnect.mjs.map +1 -1
- package/_mjs/IO/api/foreachConcurrent.mjs +1 -1
- package/_mjs/IO/api/foreachConcurrent.mjs.map +1 -1
- package/_mjs/IO/api/foreachExec.mjs +1 -1
- package/_mjs/IO/api/foreachExec.mjs.map +1 -1
- package/_mjs/IO/api/forkIn.mjs +1 -1
- package/_mjs/IO/api/forkIn.mjs.map +1 -1
- package/_mjs/IO/api/forkScoped.mjs +1 -1
- package/_mjs/IO/api/forkScoped.mjs.map +1 -1
- package/_mjs/IO/api/fulfill.mjs +1 -1
- package/_mjs/IO/api/fulfill.mjs.map +1 -1
- package/_mjs/IO/api/interrupt.mjs +19 -7
- package/_mjs/IO/api/interrupt.mjs.map +1 -1
- package/_mjs/IO/api/raceWith.mjs +4 -4
- package/_mjs/IO/api/raceWith.mjs.map +1 -1
- package/_mjs/IO/api/timeout.mjs +8 -5
- package/_mjs/IO/api/timeout.mjs.map +1 -1
- package/_mjs/IO/api/zipConcurrent.mjs +1 -1
- package/_mjs/IO/api/zipConcurrent.mjs.map +1 -1
- package/_mjs/IO/api.mjs +78 -23
- package/_mjs/IO/api.mjs.map +1 -1
- package/_mjs/IO/definition.mjs +12 -181
- package/_mjs/IO/definition.mjs.map +1 -1
- package/_mjs/IO.mjs +1 -0
- package/_mjs/IO.mjs.map +1 -1
- package/_mjs/Layer/MemoMap.mjs +1 -1
- package/_mjs/Layer/MemoMap.mjs.map +1 -1
- package/_mjs/Layer/api.mjs.map +1 -1
- package/_mjs/Push/api.mjs +223 -166
- package/_mjs/Push/api.mjs.map +1 -1
- package/_mjs/Push/definition.mjs +9 -10
- package/_mjs/Push/definition.mjs.map +1 -1
- package/_mjs/Push/internal.mjs +33 -22
- package/_mjs/Push/internal.mjs.map +1 -1
- package/_mjs/RefSubject/Atomic.mjs +15 -19
- package/_mjs/RefSubject/Atomic.mjs.map +1 -1
- package/_mjs/RefSubject/Synchronized/definition.mjs +9 -10
- package/_mjs/RefSubject/Synchronized/definition.mjs.map +1 -1
- package/_mjs/RefSubject/api.mjs +6 -7
- package/_mjs/RefSubject/api.mjs.map +1 -1
- package/_mjs/RefSubject/definition.mjs.map +1 -1
- package/_mjs/STM/api/atomically.mjs +1 -1
- package/_mjs/STM/api/atomically.mjs.map +1 -1
- package/_mjs/STM/api.mjs +2 -2
- package/_mjs/STM/api.mjs.map +1 -1
- package/_mjs/STM/definition.mjs +1 -1
- package/_mjs/STM/definition.mjs.map +1 -1
- package/_mjs/ScopedRef/api.mjs +2 -2
- package/_mjs/ScopedRef/api.mjs.map +1 -1
- package/_mjs/Semaphore.mjs +1 -1
- package/_mjs/Semaphore.mjs.map +1 -1
- package/_mjs/Sink/api.mjs +10 -10
- package/_mjs/Sink/api.mjs.map +1 -1
- package/_mjs/Subject/Atomic.mjs +4 -5
- package/_mjs/Subject/Atomic.mjs.map +1 -1
- package/_mjs/TReentrantLock/api.mjs +2 -2
- package/_mjs/TReentrantLock/api.mjs.map +1 -1
- package/_mjs/TSemaphore/api.mjs +1 -1
- package/_mjs/TSemaphore/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/dropUntilIO.mjs +12 -17
- package/_mjs/collection/immutable/Conc/dropUntilIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/dropWhileIO.mjs +12 -17
- package/_mjs/collection/immutable/Conc/dropWhileIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/filterIO.mjs +2 -12
- package/_mjs/collection/immutable/Conc/filterIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/mapIO.mjs +3 -9
- package/_mjs/collection/immutable/Conc/mapIO.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/takeWhileIO.mjs +11 -27
- package/_mjs/collection/immutable/Conc/takeWhileIO.mjs.map +1 -1
- package/_src/Channel/api.ts +3 -3
- package/_src/Fiber/FiberRuntime.ts +76 -75
- package/_src/Fiber/constructors.ts +5 -0
- package/_src/IO/api/all.ts +64 -0
- package/_src/IO/api/concurrency.ts +33 -0
- package/_src/IO/api/foreachExec.ts +2 -2
- package/_src/IO/api/interrupt.ts +20 -7
- package/_src/IO/api/raceWith.ts +4 -2
- package/_src/IO/api/timeout.ts +21 -1
- package/_src/IO/api.ts +79 -27
- package/_src/IO/definition.ts +155 -200
- package/_src/IO.ts +1 -0
- package/_src/Layer/api.ts +0 -1
- package/_src/Push/api.ts +305 -304
- package/_src/Push/definition.ts +19 -17
- package/_src/Push/internal.ts +63 -31
- package/_src/RefSubject/Atomic.ts +16 -22
- package/_src/RefSubject/Synchronized/definition.ts +6 -9
- package/_src/RefSubject/api.ts +9 -12
- package/_src/RefSubject/definition.ts +6 -8
- package/_src/STM/api.ts +0 -5
- package/_src/STM/definition.ts +8 -2
- package/_src/Sink/api.ts +9 -9
- package/_src/Subject/Atomic.ts +6 -8
- package/_src/Subject/definition.ts +2 -2
- package/_src/collection/immutable/Conc/dropUntilIO.ts +18 -15
- package/_src/collection/immutable/Conc/dropWhileIO.ts +18 -17
- package/_src/collection/immutable/Conc/filterIO.ts +1 -11
- package/_src/collection/immutable/Conc/mapIO.ts +2 -9
- package/_src/collection/immutable/Conc/takeWhileIO.ts +19 -28
- package/collection/immutable/Conc/filterIO.d.ts +1 -1
- package/collection/immutable/Conc/mapIO.d.ts +1 -1
- package/collection/immutable/Conc/takeWhileIO.d.ts +1 -1
- package/package.json +2 -2
package/_mjs/Push/api.mjs
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
const fileName_1 = "(@fncts/io) src/Push/api.ts";
|
|
3
|
-
import * as tsplus_module_1 from "@fncts/io/
|
|
4
|
-
import * as tsplus_module_2 from "@fncts/io/
|
|
5
|
-
import * as tsplus_module_3 from "@fncts/
|
|
6
|
-
import * as tsplus_module_4 from "@fncts/io/
|
|
7
|
-
import * as tsplus_module_5 from "@fncts/
|
|
8
|
-
import * as tsplus_module_6 from "@fncts/io/IO/api/
|
|
9
|
-
import * as tsplus_module_7 from "@fncts/io/IO/
|
|
10
|
-
import * as tsplus_module_8 from "@fncts/io/
|
|
11
|
-
import * as tsplus_module_9 from "@fncts/io/
|
|
12
|
-
import * as tsplus_module_10 from "@fncts/io/
|
|
13
|
-
import * as tsplus_module_11 from "@fncts/io/
|
|
14
|
-
import * as tsplus_module_12 from "@fncts/
|
|
15
|
-
import * as tsplus_module_13 from "@fncts/
|
|
16
|
-
import * as tsplus_module_14 from "@fncts/
|
|
17
|
-
import * as tsplus_module_15 from "@fncts/io/IO/api/
|
|
18
|
-
import * as tsplus_module_16 from "@fncts/base/data/
|
|
19
|
-
import * as tsplus_module_17 from "@fncts/io/
|
|
20
|
-
import * as tsplus_module_18 from "@fncts/io/
|
|
21
|
-
import * as tsplus_module_19 from "@fncts/
|
|
22
|
-
import * as tsplus_module_20 from "@fncts/io/
|
|
23
|
-
import * as tsplus_module_21 from "@fncts/io/IO/api/
|
|
24
|
-
import * as tsplus_module_22 from "@fncts/io/
|
|
25
|
-
import * as tsplus_module_23 from "@fncts/
|
|
26
|
-
import * as tsplus_module_24 from "@fncts/
|
|
27
|
-
import * as tsplus_module_25 from "@fncts/base/data/
|
|
28
|
-
import * as tsplus_module_26 from "@fncts/
|
|
3
|
+
import * as tsplus_module_1 from "@fncts/io/Future/api";
|
|
4
|
+
import * as tsplus_module_2 from "@fncts/io/IO/api/interrupt";
|
|
5
|
+
import * as tsplus_module_3 from "@fncts/base/data/Either/destructors";
|
|
6
|
+
import * as tsplus_module_4 from "@fncts/io/IO/api";
|
|
7
|
+
import * as tsplus_module_5 from "@fncts/io/IO/api/forkIn";
|
|
8
|
+
import * as tsplus_module_6 from "@fncts/io/IO/api/fulfill";
|
|
9
|
+
import * as tsplus_module_7 from "@fncts/io/IO/runtime";
|
|
10
|
+
import * as tsplus_module_8 from "@fncts/io/IO/api/scope";
|
|
11
|
+
import * as tsplus_module_9 from "@fncts/io/Future/constructors";
|
|
12
|
+
import * as tsplus_module_10 from "@fncts/io/IO/api/scoped";
|
|
13
|
+
import * as tsplus_module_11 from "@fncts/io/Push/definition";
|
|
14
|
+
import * as tsplus_module_12 from "@fncts/base/data/Either/constructors";
|
|
15
|
+
import * as tsplus_module_13 from "@fncts/base/collection/Iterable/api";
|
|
16
|
+
import * as tsplus_module_14 from "@fncts/io/IO/api/foreachConcurrent";
|
|
17
|
+
import * as tsplus_module_15 from "@fncts/io/IO/api/delay";
|
|
18
|
+
import * as tsplus_module_16 from "@fncts/base/data/Maybe/destructors";
|
|
19
|
+
import * as tsplus_module_17 from "@fncts/io/Semaphore";
|
|
20
|
+
import * as tsplus_module_18 from "@fncts/io/IO/api/concurrency";
|
|
21
|
+
import * as tsplus_module_19 from "@fncts/base/data/function/api";
|
|
22
|
+
import * as tsplus_module_20 from "@fncts/io/IO/api/asyncIO";
|
|
23
|
+
import * as tsplus_module_21 from "@fncts/io/IO/api/forkDaemon";
|
|
24
|
+
import * as tsplus_module_22 from "@fncts/io/Fiber/api/await";
|
|
25
|
+
import * as tsplus_module_23 from "@fncts/io/IO/api/environment";
|
|
26
|
+
import * as tsplus_module_24 from "@fncts/io/Fiber/api/interrupt";
|
|
27
|
+
import * as tsplus_module_25 from "@fncts/base/data/Maybe/constructors";
|
|
28
|
+
import * as tsplus_module_26 from "@fncts/base/data/Maybe/definition";
|
|
29
29
|
import * as tsplus_module_27 from "@fncts/base/data/Cause/api";
|
|
30
|
-
import * as tsplus_module_28 from "@fncts/io/
|
|
31
|
-
import * as tsplus_module_29 from "@fncts/
|
|
32
|
-
import * as tsplus_module_30 from "@fncts/
|
|
33
|
-
import * as tsplus_module_31 from "@fncts/io/
|
|
34
|
-
import * as tsplus_module_32 from "@fncts/io/
|
|
30
|
+
import * as tsplus_module_28 from "@fncts/io/Fiber/api/interruptFork";
|
|
31
|
+
import * as tsplus_module_29 from "@fncts/io/IO/api/forkScoped";
|
|
32
|
+
import * as tsplus_module_30 from "@fncts/base/collection/immutable/Conc/definition";
|
|
33
|
+
import * as tsplus_module_31 from "@fncts/io/Fiber/api/joinAll";
|
|
34
|
+
import * as tsplus_module_32 from "@fncts/io/IO/api/fork";
|
|
35
35
|
import * as tsplus_module_33 from "@fncts/io/IO/api/asyncInterrupt";
|
|
36
|
+
export const asyncInterrupt = asyncInterrupt_1;
|
|
36
37
|
export const combineLatest = combineLatest_1;
|
|
38
|
+
export const exhaustMap = exhaustMap_1;
|
|
37
39
|
export const flatMapConcurrentBounded = flatMapConcurrentBounded_1;
|
|
38
40
|
export const flatMapConcurrentUnbounded = flatMapConcurrentUnbounded_1;
|
|
39
41
|
export const flatMap = flatMap_1;
|
|
@@ -42,13 +44,17 @@ export const fromIO = fromIO_1;
|
|
|
42
44
|
export const map = map_1;
|
|
43
45
|
export const mapIO = mapIO_1;
|
|
44
46
|
export const mergeAll = mergeAll_1;
|
|
47
|
+
export const observe = observe_1;
|
|
45
48
|
export const scoped = scoped_1;
|
|
49
|
+
export const switchMap = switchMap_1;
|
|
50
|
+
export const switchMapIO = switchMapIO_1;
|
|
46
51
|
export const transform = transform_1;
|
|
47
52
|
export const unfoldIO = unfoldIO_1;
|
|
48
53
|
export const unwrap = unwrap_1;
|
|
49
54
|
import { AtomicReference } from "@fncts/base/internal/AtomicReference";
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
55
|
+
import { IO } from "@fncts/io/IO";
|
|
56
|
+
import { withExhaust, withSwitch, withUnboundedConcurrency } from "@fncts/io/Push/internal";
|
|
57
|
+
import { Push, PushTypeId, PushVariance, Sink } from "./definition.mjs";
|
|
52
58
|
/**
|
|
53
59
|
* @tsplus pipeable fncts.io.Push as
|
|
54
60
|
*/
|
|
@@ -57,13 +63,34 @@ export function as(b) {
|
|
|
57
63
|
return map_1(b)(self);
|
|
58
64
|
};
|
|
59
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* @tsplus static fncts.io.PushOps asyncInterrupt
|
|
68
|
+
*/
|
|
69
|
+
function asyncInterrupt_1(make) {
|
|
70
|
+
return tsplus_module_11.makePush(sink => tsplus_module_10.scoped(tsplus_module_4.flatMap(future => tsplus_module_4.flatMap(scope => tsplus_module_4.flatMap(runtime => {
|
|
71
|
+
const unsafeSink = {
|
|
72
|
+
event: value => runtime.unsafeRunOrFork(tsplus_module_5.forkIn(scope, fileName_1 + ":34:77")(sink.event(value)), fileName_1 + ":34:52"),
|
|
73
|
+
error: cause => runtime.unsafeRunOrFork(tsplus_module_5.forkIn(scope, fileName_1 + ":35:93")(tsplus_module_6.fulfill(future, fileName_1 + ":35:78")(sink.error(cause))), fileName_1 + ":35:52")
|
|
74
|
+
};
|
|
75
|
+
return tsplus_module_4.flatMap(eitherPush => tsplus_module_4.map(() => void 0, fileName_1 + ":38:10")(tsplus_module_3.match(canceller => tsplus_module_2.onInterrupt(() => canceller, fileName_1 + ":40:52")(tsplus_module_1.wait(future, fileName_1 + ":40:34")), push => push.run(sink))(eitherPush)), fileName_1 + ":37:29")(tsplus_module_4.succeed(() => make(unsafeSink), fileName_1 + ":37:32"));
|
|
76
|
+
}, fileName_1 + ":32:26")(tsplus_module_7.runtime(fileName_1 + ":32:37")), fileName_1 + ":31:26")(tsplus_module_8.scope), fileName_1 + ":30:26")(tsplus_module_9.make(fileName_1 + ":30:38")), fileName_1 + ":44:9"));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @tsplus static fncts.io.PushOps async
|
|
80
|
+
*/
|
|
81
|
+
export function async(make) {
|
|
82
|
+
return asyncInterrupt_1(sink => {
|
|
83
|
+
make(sink);
|
|
84
|
+
return tsplus_module_12.left(tsplus_module_4.unit, fileName_1 + ":54:23");
|
|
85
|
+
});
|
|
86
|
+
}
|
|
60
87
|
function combineLatest_1(streams) {
|
|
61
|
-
return
|
|
62
|
-
const size =
|
|
63
|
-
return
|
|
64
|
-
const emitIfReady =
|
|
65
|
-
return
|
|
66
|
-
}, fileName_1 + ":
|
|
88
|
+
return tsplus_module_11.makePush(emitter => (() => {
|
|
89
|
+
const size = tsplus_module_13.size(streams);
|
|
90
|
+
return tsplus_module_4.flatMap(ref => {
|
|
91
|
+
const emitIfReady = tsplus_module_4.flatMap(as => as.length === size ? emitter.event(as) : tsplus_module_4.unit, fileName_1 + ":70:69")(tsplus_module_4.succeed(() => ref.filter(a => a != null), fileName_1 + ":70:31"));
|
|
92
|
+
return tsplus_module_4.map(() => void 0, fileName_1 + ":73:8")(tsplus_module_14.foreachConcurrent(tsplus_module_13.zipWithIndex(streams), ([i, stream]) => stream.run(tsplus_module_11.makeSink(value => tsplus_module_4.zipRight(emitIfReady, fileName_1 + ":77:48")(tsplus_module_4.succeed(() => ref[i] = value, fileName_1 + ":77:28")), cause => emitter.error(cause))), fileName_1 + ":74:29"));
|
|
93
|
+
}, fileName_1 + ":69:30")(tsplus_module_4.succeed(() => Array(size), fileName_1 + ":69:33"));
|
|
67
94
|
})());
|
|
68
95
|
}
|
|
69
96
|
/**
|
|
@@ -79,21 +106,66 @@ export function combineLatestWith(that, f) {
|
|
|
79
106
|
*/
|
|
80
107
|
export function debounce(duration) {
|
|
81
108
|
return self => {
|
|
82
|
-
return
|
|
109
|
+
return switchMapIO_1(a => tsplus_module_15.delay(duration)(tsplus_module_4.succeedNow(a, fileName_1 + ":101:49")))(self);
|
|
83
110
|
};
|
|
84
111
|
}
|
|
85
112
|
/**
|
|
86
113
|
* @tsplus static fncts.io.PushOps defer
|
|
87
114
|
*/
|
|
88
115
|
export function defer(self) {
|
|
89
|
-
return
|
|
116
|
+
return tsplus_module_11.makePush(emitter => tsplus_module_4.flatMap(push => push.run(emitter), fileName_1 + ":109:44")(tsplus_module_4.succeed(self, fileName_1 + ":109:30")));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @tsplus pipeable fncts.io.Push exhaustMap
|
|
120
|
+
*/
|
|
121
|
+
function exhaustMap_1(f) {
|
|
122
|
+
return self => {
|
|
123
|
+
return tsplus_module_11.makePush(sink => withExhaust(fork => self.run(tsplus_module_11.makeSink(a => fork(f(a).run(sink)), sink.error))));
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* @tsplus pipeable fncts.io.Push exhaustMapIO
|
|
128
|
+
*/
|
|
129
|
+
export function exhaustMapIO(f) {
|
|
130
|
+
return self => {
|
|
131
|
+
return exhaustMap_1(a => fromIO_1(() => f(a)))(self);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @tsplus pipeable fncts.io.Push filterIO
|
|
136
|
+
*/
|
|
137
|
+
export function filterIO(predicate) {
|
|
138
|
+
return self => {
|
|
139
|
+
return tsplus_module_11.makePush(sink => self.run(tsplus_module_11.makeSink(a => tsplus_module_4.catchAllCause(sink.error, fileName_1 + ":141:29")(tsplus_module_4.flatMap(b => b ? sink.event(a) : tsplus_module_4.unit, fileName_1 + ":140:23")(predicate(a))), sink.error)));
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @tsplus pipeable fncts.io.Push filterMapIO
|
|
144
|
+
*/
|
|
145
|
+
export function filterMapIO(f) {
|
|
146
|
+
return self => {
|
|
147
|
+
return tsplus_module_11.makePush(sink => self.run(tsplus_module_11.makeSink(a => tsplus_module_4.catchAllCause(sink.error, fileName_1 + ":160:29")(tsplus_module_4.flatMap(mb => tsplus_module_16.match(() => tsplus_module_4.unit, sink.event)(mb), fileName_1 + ":159:23")(f(a))), sink.error)));
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
export function filter(predicate) {
|
|
151
|
+
return self => {
|
|
152
|
+
return tsplus_module_11.makePush(sink => self.run(tsplus_module_11.makeSink(a => predicate(a) ? sink.event(a) : tsplus_module_4.unit, sink.error)));
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* @tsplus pipeable fncts.io.Push filterMap
|
|
157
|
+
*/
|
|
158
|
+
export function filterMap(f) {
|
|
159
|
+
return self => {
|
|
160
|
+
return tsplus_module_11.makePush(sink => self.run(tsplus_module_11.makeSink(a => tsplus_module_16.match(() => tsplus_module_4.unit, sink.event)(f(a)), sink.error)));
|
|
161
|
+
};
|
|
90
162
|
}
|
|
91
163
|
/**
|
|
92
164
|
* @tsplus pipeable fncts.io.Push flatMapConcurrentBounded
|
|
93
165
|
*/
|
|
94
166
|
function flatMapConcurrentBounded_1(f, concurrency) {
|
|
95
167
|
return self => {
|
|
96
|
-
return
|
|
168
|
+
return tsplus_module_11.makePush(emitter => tsplus_module_4.flatMap(semaphore => tsplus_module_4.map(() => void 0, fileName_1 + ":196:10")(flatMapConcurrentUnbounded_1(a => transform_1(io => semaphore.withPermit(io))(f(a)))(self).run(emitter)), fileName_1 + ":195:28")(tsplus_module_17.makeSemaphore(concurrency, fileName_1 + ":195:38")));
|
|
97
169
|
};
|
|
98
170
|
}
|
|
99
171
|
/**
|
|
@@ -101,7 +173,7 @@ function flatMapConcurrentBounded_1(f, concurrency) {
|
|
|
101
173
|
*/
|
|
102
174
|
function flatMapConcurrentUnbounded_1(f) {
|
|
103
175
|
return self => {
|
|
104
|
-
return
|
|
176
|
+
return tsplus_module_11.makePush(sink => withUnboundedConcurrency(fork => self.run(tsplus_module_11.makeSink(a => fork(f(a).run(sink)), sink.error))));
|
|
105
177
|
};
|
|
106
178
|
}
|
|
107
179
|
/**
|
|
@@ -109,7 +181,7 @@ function flatMapConcurrentUnbounded_1(f) {
|
|
|
109
181
|
*/
|
|
110
182
|
export function flatMapConcurrent(f) {
|
|
111
183
|
return self => {
|
|
112
|
-
return unwrap_1(
|
|
184
|
+
return unwrap_1(tsplus_module_4.map(concurrency => tsplus_module_16.match(() => flatMapConcurrentUnbounded_1(f)(self), n => flatMapConcurrentBounded_1(f, n)(self))(concurrency), fileName_1 + ":217:25")(tsplus_module_18.concurrency));
|
|
113
185
|
};
|
|
114
186
|
}
|
|
115
187
|
/**
|
|
@@ -124,34 +196,34 @@ function flatMap_1(f) {
|
|
|
124
196
|
* @tsplus getter fncts.io.Push flatten
|
|
125
197
|
*/
|
|
126
198
|
function flatten_1(self) {
|
|
127
|
-
return flatMap_1(
|
|
199
|
+
return flatMap_1(tsplus_module_19.identity)(self);
|
|
128
200
|
}
|
|
129
201
|
/**
|
|
130
202
|
* @tsplus static fncts.io.PushOps fromIO
|
|
131
203
|
*/
|
|
132
204
|
function fromIO_1(io) {
|
|
133
|
-
return
|
|
205
|
+
return tsplus_module_11.makePush(emitter => tsplus_module_4.matchCauseIO(cause => emitter.error(cause), value => emitter.event(value), fileName_1 + ":248:30")(tsplus_module_4.defer(io, fileName_1 + ":248:13")));
|
|
134
206
|
}
|
|
135
207
|
/**
|
|
136
208
|
* @tsplus static fncts.io.PushOps fromAsyncIterable
|
|
137
209
|
*/
|
|
138
210
|
export function fromAsyncIterable(iterable) {
|
|
139
|
-
return
|
|
211
|
+
return tsplus_module_11.makePush(sink => tsplus_module_20.asyncIO(cb => tsplus_module_4.defer(() => fromAsyncIterableLoop(iterable[Symbol.asyncIterator](), sink, cb, fileName_1 + ":260:70"), fileName_1 + ":260:48"), fileName_1 + ":260:15"));
|
|
140
212
|
}
|
|
141
|
-
function fromAsyncIterableLoop(iterator,
|
|
142
|
-
return
|
|
213
|
+
function fromAsyncIterableLoop(iterator, sink, cb, __tsplusTrace) {
|
|
214
|
+
return tsplus_module_4.matchCauseIO(cause => sink.error(cause), result => result.done ? tsplus_module_4.succeed(() => cb(tsplus_module_4.unit), __tsplusTrace) : tsplus_module_4.zipRight(fromAsyncIterableLoop(iterator, sink, cb, __tsplusTrace), __tsplusTrace)(sink.event(result.value)), __tsplusTrace)(tsplus_module_4.fromPromiseHalt(iterator.next, __tsplusTrace));
|
|
143
215
|
}
|
|
144
216
|
/**
|
|
145
217
|
* @tsplus static fncts.io.PushOps fromIterable
|
|
146
218
|
*/
|
|
147
219
|
export function fromIterable(iterable) {
|
|
148
|
-
return
|
|
220
|
+
return tsplus_module_11.makePush(sink => tsplus_module_20.asyncIO(cb => tsplus_module_4.defer(() => fromIterableLoop(iterable[Symbol.iterator](), sink, cb), fileName_1 + ":281:48"), fileName_1 + ":281:15"));
|
|
149
221
|
}
|
|
150
|
-
function fromIterableLoop(iterator,
|
|
151
|
-
return
|
|
222
|
+
function fromIterableLoop(iterator, sink, cb) {
|
|
223
|
+
return tsplus_module_4.defer(() => {
|
|
152
224
|
const value = iterator.next();
|
|
153
|
-
return value.done ?
|
|
154
|
-
}, fileName_1 + ":
|
|
225
|
+
return value.done ? tsplus_module_4.succeed(() => cb(tsplus_module_4.unit), fileName_1 + ":292:27") : tsplus_module_4.zipRight(fromIterableLoop(iterator, sink, cb), fileName_1 + ":292:68")(sink.event(value.value));
|
|
226
|
+
}, fileName_1 + ":290:18");
|
|
155
227
|
}
|
|
156
228
|
/**
|
|
157
229
|
* @tsplus getter fncts.io.Push multicast
|
|
@@ -165,45 +237,46 @@ export class Multicast {
|
|
|
165
237
|
this[_a] = PushTypeId;
|
|
166
238
|
this.observers = [];
|
|
167
239
|
}
|
|
168
|
-
run(
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
return tsplus_module_1.unit;
|
|
177
|
-
} else {
|
|
178
|
-
return tsplus_module_1.tap(fiber => tsplus_module_1.succeed(() => this.fiber = fiber, fileName_1 + ":249:44"), fileName_1 + ":249:30")(tsplus_module_3.forkScoped(tsplus_module_19.schedule(() => tsplus_module_18.asap, fileName_1 + ":248:24")(this.push.run(this)), fileName_1 + ":248:39"));
|
|
240
|
+
run(sink) {
|
|
241
|
+
return tsplus_module_4.flatMap(environment => tsplus_module_4.map(() => void 0, fileName_1 + ":322:8")(tsplus_module_4.defer(() => {
|
|
242
|
+
let io = tsplus_module_4.unit;
|
|
243
|
+
if (this.observers.push({
|
|
244
|
+
sink: sink,
|
|
245
|
+
environment
|
|
246
|
+
}) === 1) {
|
|
247
|
+
io = tsplus_module_4.flatMap(fiber => tsplus_module_4.succeed(() => this.fiber = fiber, fileName_1 + ":326:70"), fileName_1 + ":326:56")(tsplus_module_21.forkDaemon(this.push.run(this), fileName_1 + ":326:37"));
|
|
179
248
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
emit(value) {
|
|
183
|
-
return tsplus_module_1.defer(() => tsplus_module_1.foreachDiscard(this.observers.slice(), observer => this.runEvent(value, observer), fileName_1 + ":258:38"), fileName_1 + ":258:20");
|
|
184
|
-
}
|
|
185
|
-
failCause(cause) {
|
|
186
|
-
return tsplus_module_1.zipRight(tsplus_module_1.defer(() => this.cleanup(), fileName_1 + ":264:15"), fileName_1 + ":263:110")(tsplus_module_1.defer(() => tsplus_module_1.foreachDiscard(this.observers.slice(), observer => this.runFailCause(cause, observer), fileName_1 + ":263:33"), fileName_1 + ":263:15"));
|
|
249
|
+
return tsplus_module_4.zipRight(tsplus_module_2.ensuring(this.removeSink(sink), fileName_1 + ":328:49")(tsplus_module_22.wait(this.fiber, fileName_1 + ":328:34")), fileName_1 + ":328:22")(io);
|
|
250
|
+
}, fileName_1 + ":323:17")), fileName_1 + ":321:28")(tsplus_module_23.environment(fileName_1 + ":321:43"));
|
|
187
251
|
}
|
|
188
|
-
|
|
189
|
-
return
|
|
252
|
+
event(value) {
|
|
253
|
+
return tsplus_module_4.defer(() => tsplus_module_4.foreachDiscard(this.observers.slice(), observer => this.runValue(value, observer), fileName_1 + ":335:38"), fileName_1 + ":335:20");
|
|
190
254
|
}
|
|
191
|
-
|
|
192
|
-
return
|
|
255
|
+
error(cause) {
|
|
256
|
+
return tsplus_module_4.defer(() => tsplus_module_4.foreachDiscard(this.observers.slice(), observer => this.runError(cause, observer), fileName_1 + ":339:38"), fileName_1 + ":339:20");
|
|
193
257
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
return tsplus_module_21.provideEnvironment(observer.environment, fileName_1 + ":284:89")(tsplus_module_22.fulfill(observer.future, fileName_1 + ":284:53")(observer.emitter.failCause(cause)));
|
|
258
|
+
runValue(value, observer) {
|
|
259
|
+
return tsplus_module_4.catchAllCause(() => this.removeSink(observer.sink), fileName_1 + ":346:21")(tsplus_module_23.provideEnvironment(observer.environment, fileName_1 + ":345:26")(observer.sink.event(value)));
|
|
197
260
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return tsplus_module_21.provideEnvironment(observer.environment, fileName_1 + ":289:76")(tsplus_module_22.fulfill(observer.future, fileName_1 + ":289:40")(observer.emitter.end));
|
|
261
|
+
runError(cause, observer) {
|
|
262
|
+
return tsplus_module_4.catchAllCause(() => this.removeSink(observer.sink), fileName_1 + ":353:21")(tsplus_module_23.provideEnvironment(observer.environment, fileName_1 + ":352:26")(observer.sink.error(cause)));
|
|
201
263
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
264
|
+
removeSink(sink) {
|
|
265
|
+
return tsplus_module_4.defer(() => {
|
|
266
|
+
if (this.observers.length === 0) {
|
|
267
|
+
return tsplus_module_4.unit;
|
|
268
|
+
}
|
|
269
|
+
const index = this.observers.findIndex(observer => observer.sink === sink);
|
|
270
|
+
if (index > -1) {
|
|
271
|
+
this.observers.splice(index, 1);
|
|
272
|
+
if (this.observers.length === 0) {
|
|
273
|
+
const interrupt = tsplus_module_24.interrupt(this.fiber);
|
|
274
|
+
this.fiber = undefined;
|
|
275
|
+
return interrupt;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return tsplus_module_4.unit;
|
|
279
|
+
}, fileName_1 + ":357:20");
|
|
207
280
|
}
|
|
208
281
|
}
|
|
209
282
|
_a = PushTypeId;
|
|
@@ -217,63 +290,20 @@ export class Hold extends Multicast {
|
|
|
217
290
|
constructor(push) {
|
|
218
291
|
super(push);
|
|
219
292
|
this.push = push;
|
|
220
|
-
this.
|
|
221
|
-
this.pendingEmitters = [];
|
|
222
|
-
this.scheduledFiber = null;
|
|
223
|
-
}
|
|
224
|
-
run(emitter) {
|
|
225
|
-
if (this.shouldScheduleFlush()) {
|
|
226
|
-
return tsplus_module_1.flatMap(() => super.run(emitter), fileName_1 + ":318:49")(this.scheduleFlush(emitter));
|
|
227
|
-
}
|
|
228
|
-
const value = this.value.get;
|
|
229
|
-
if (tsplus_module_24.isJust(value) && this.observers.length === 0) {
|
|
230
|
-
return tsplus_module_1.flatMap(() => super.run(emitter), fileName_1 + ":323:47")(emitter.emit(value.value));
|
|
231
|
-
}
|
|
232
|
-
return super.run(emitter);
|
|
233
|
-
}
|
|
234
|
-
emit(value) {
|
|
235
|
-
return tsplus_module_1.defer(() => {
|
|
236
|
-
this.addValue(value);
|
|
237
|
-
return tsplus_module_1.flatMap(() => super.emit(value), fileName_1 + ":332:41")(this.flushPending());
|
|
238
|
-
}, fileName_1 + ":330:20");
|
|
239
|
-
}
|
|
240
|
-
failCause(cause) {
|
|
241
|
-
return tsplus_module_1.defer(() => tsplus_module_1.flatMap(() => super.failCause(cause), fileName_1 + ":337:48")(this.flushPending()), fileName_1 + ":337:20");
|
|
242
|
-
}
|
|
243
|
-
get end() {
|
|
244
|
-
return tsplus_module_1.defer(() => tsplus_module_1.flatMap(() => super.end, fileName_1 + ":341:48")(this.flushPending()), fileName_1 + ":341:20");
|
|
245
|
-
}
|
|
246
|
-
shouldScheduleFlush() {
|
|
247
|
-
return tsplus_module_24.isJust(this.value.get) && this.observers.length > 0;
|
|
248
|
-
}
|
|
249
|
-
scheduleFlush(observer) {
|
|
250
|
-
this.pendingEmitters.push([observer, tsplus_module_14.match(() => [], a => [a])(this.value.get)]);
|
|
251
|
-
const interrupt = this.scheduledFiber ? tsplus_module_26.interruptAsFork(this.scheduledFiber, tsplus_module_25.none) : tsplus_module_1.unit;
|
|
252
|
-
this.scheduledFiber = null;
|
|
253
|
-
return tsplus_module_1.tap(fiber => tsplus_module_1.succeed(() => this.scheduledFiber = fiber, fileName_1 + ":361:9"), fileName_1 + ":360:87")(tsplus_module_3.forkScoped(tsplus_module_1.zipRight(tsplus_module_1.flatMap(() => this.flushPending(), fileName_1 + ":360:44")(interrupt), fileName_1 + ":360:26")(tsplus_module_1.yieldNow), fileName_1 + ":360:72"));
|
|
293
|
+
this.current = new AtomicReference(tsplus_module_25.nothing(fileName_1 + ":383:49"));
|
|
254
294
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
295
|
+
run(sink) {
|
|
296
|
+
const current = this.current.get;
|
|
297
|
+
if (tsplus_module_26.isJust(current)) {
|
|
298
|
+
return tsplus_module_4.zipRight(super.run(sink), fileName_1 + ":393:41")(sink.event(current.value));
|
|
258
299
|
}
|
|
259
|
-
|
|
260
|
-
this.pendingEmitters = [];
|
|
261
|
-
return tsplus_module_1.foreachDiscard(emitters, pendingEmitter => {
|
|
262
|
-
return tsplus_module_1.defer(() => {
|
|
263
|
-
const [emitter, values] = pendingEmitter;
|
|
264
|
-
const observer = this.observers.find(observer => observer.emitter === emitter);
|
|
265
|
-
if (!observer) {
|
|
266
|
-
return tsplus_module_1.unit;
|
|
267
|
-
}
|
|
268
|
-
return tsplus_module_1.foreachDiscard(values, value => this.runEvent(value, observer), fileName_1 + ":380:33");
|
|
269
|
-
}, fileName_1 + ":374:22");
|
|
270
|
-
}, fileName_1 + ":373:29");
|
|
300
|
+
return super.run(sink);
|
|
271
301
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
});
|
|
302
|
+
event(value) {
|
|
303
|
+
return tsplus_module_4.defer(() => {
|
|
304
|
+
this.current.set(tsplus_module_25.just(value, fileName_1 + ":401:28"));
|
|
305
|
+
return super.event(value);
|
|
306
|
+
}, fileName_1 + ":400:20");
|
|
277
307
|
}
|
|
278
308
|
}
|
|
279
309
|
/**
|
|
@@ -281,7 +311,7 @@ export class Hold extends Multicast {
|
|
|
281
311
|
*/
|
|
282
312
|
function map_1(f) {
|
|
283
313
|
return self => {
|
|
284
|
-
return mapIO_1(a =>
|
|
314
|
+
return mapIO_1(a => tsplus_module_4.succeedNow(f(a), fileName_1 + ":412:43"))(self);
|
|
285
315
|
};
|
|
286
316
|
}
|
|
287
317
|
/**
|
|
@@ -289,7 +319,7 @@ function map_1(f) {
|
|
|
289
319
|
*/
|
|
290
320
|
export function mapError(f) {
|
|
291
321
|
return self => {
|
|
292
|
-
return
|
|
322
|
+
return tsplus_module_11.makePush(emitter => self.run(tsplus_module_11.makeSink(value => emitter.event(value), cause => emitter.error(tsplus_module_27.map(f)(cause)))));
|
|
293
323
|
};
|
|
294
324
|
}
|
|
295
325
|
/**
|
|
@@ -297,14 +327,14 @@ export function mapError(f) {
|
|
|
297
327
|
*/
|
|
298
328
|
export function mapErrorCause(f) {
|
|
299
329
|
return self => {
|
|
300
|
-
return
|
|
330
|
+
return tsplus_module_11.makePush(emitter => self.run(tsplus_module_11.makeSink(value => emitter.event(value), cause => emitter.error(f(cause)))));
|
|
301
331
|
};
|
|
302
332
|
}
|
|
303
333
|
/**
|
|
304
334
|
* @tsplus pipeable fncts.io.Push mapIO
|
|
305
335
|
*/
|
|
306
336
|
function mapIO_1(f) {
|
|
307
|
-
return self =>
|
|
337
|
+
return self => tsplus_module_11.makePush(emitter => self.run(tsplus_module_11.makeSink(value => tsplus_module_4.matchCauseIO(cause => emitter.error(cause), b => emitter.event(b), fileName_1 + ":457:34")(f(value)), cause => emitter.error(cause))));
|
|
308
338
|
}
|
|
309
339
|
/**
|
|
310
340
|
* @tsplus pipeable fncts.io.Push merge
|
|
@@ -315,82 +345,106 @@ export function merge(that) {
|
|
|
315
345
|
};
|
|
316
346
|
}
|
|
317
347
|
function mergeAll_1(streams) {
|
|
318
|
-
return
|
|
348
|
+
return tsplus_module_11.makePush(sink => tsplus_module_14.foreachConcurrentDiscard(streams, stream => stream.run(tsplus_module_11.makeSink(sink.event, cause => tsplus_module_27.isInterruptedOnly(cause) ? tsplus_module_4.unit : sink.error(cause))), fileName_1 + ":485:32"));
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* @tsplus pipeable fncts.io.Push observe
|
|
352
|
+
*/
|
|
353
|
+
function observe_1(f, __tsplusTrace) {
|
|
354
|
+
return self => {
|
|
355
|
+
return tsplus_module_4.flatMap(future => tsplus_module_4.flatMap(fiber => tsplus_module_4.flatMap(() => tsplus_module_4.map(() => void 0, __tsplusTrace)(tsplus_module_28.interruptFork(fiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_1.wait(future, __tsplusTrace)), __tsplusTrace)(tsplus_module_29.forkScoped(tsplus_module_4.flatMap(() => tsplus_module_1.succeed_(undefined, __tsplusTrace)(future), __tsplusTrace)(self.run(tsplus_module_11.makeSink(a => tsplus_module_4.catchAllCause(cause => tsplus_module_1.failCause(cause, __tsplusTrace)(future), __tsplusTrace)(f(a)), cause => tsplus_module_1.failCause(cause, __tsplusTrace)(future)))), __tsplusTrace)), __tsplusTrace)(tsplus_module_9.make(__tsplusTrace));
|
|
356
|
+
};
|
|
319
357
|
}
|
|
320
358
|
/**
|
|
321
359
|
* @tsplus static fncts.io.PushOps repeatIOMaybe
|
|
322
360
|
*/
|
|
323
361
|
export function repeatIOMaybe(io, __tsplusTrace) {
|
|
324
|
-
return unfoldIO_1(undefined, () =>
|
|
362
|
+
return unfoldIO_1(undefined, () => tsplus_module_4.catchAll(maybeError => tsplus_module_16.match(() => tsplus_module_4.succeedNow(tsplus_module_25.nothing(__tsplusTrace), __tsplusTrace), tsplus_module_4.failNow)(maybeError), __tsplusTrace)(tsplus_module_4.map(a => tsplus_module_25.just([a, undefined], __tsplusTrace), __tsplusTrace)(io)));
|
|
325
363
|
}
|
|
326
364
|
/**
|
|
327
365
|
* @tsplus getter fncts.io.Push runCollect
|
|
328
366
|
*/
|
|
329
367
|
export function runCollect(self) {
|
|
330
|
-
return
|
|
368
|
+
return tsplus_module_4.defer(() => {
|
|
331
369
|
const out = [];
|
|
332
|
-
return
|
|
333
|
-
}, fileName_1 + ":
|
|
370
|
+
return tsplus_module_4.as(() => tsplus_module_30.fromArray(out), fileName_1 + ":532:51")(observe_1(a => tsplus_module_4.succeed(() => out.push(a), fileName_1 + ":532:34"), fileName_1 + ":532:24")(self));
|
|
371
|
+
}, fileName_1 + ":530:18");
|
|
334
372
|
}
|
|
335
373
|
/**
|
|
336
374
|
* @tsplus getter fncts.io.Push runDrain
|
|
337
375
|
*/
|
|
338
376
|
export function runDrain(self) {
|
|
339
|
-
return
|
|
377
|
+
return observe_1(() => tsplus_module_4.unit, fileName_1 + ":540:22")(self);
|
|
340
378
|
}
|
|
341
379
|
/**
|
|
342
380
|
* @tsplus static fncts.io.PushOps scoped
|
|
343
381
|
*/
|
|
344
382
|
function scoped_1(io, __tsplusTrace) {
|
|
345
|
-
return
|
|
383
|
+
return tsplus_module_11.makePush(emitter => tsplus_module_4.matchCauseIO(cause => emitter.error(cause), value => emitter.event(value), __tsplusTrace)(tsplus_module_10.scoped(tsplus_module_4.defer(io, __tsplusTrace), __tsplusTrace)));
|
|
346
384
|
}
|
|
347
385
|
/**
|
|
348
386
|
* @tsplus static fncts.io.PushOps succeed
|
|
349
387
|
*/
|
|
350
388
|
export function succeed(value) {
|
|
351
|
-
return fromIO_1(() =>
|
|
389
|
+
return fromIO_1(() => tsplus_module_4.succeed(value, fileName_1 + ":559:32"));
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* @tsplus pipeable fncts.io.Push switchMap
|
|
393
|
+
*/
|
|
394
|
+
function switchMap_1(f) {
|
|
395
|
+
return self => {
|
|
396
|
+
return tsplus_module_11.makePush(sink => withSwitch(fork => self.run(tsplus_module_11.makeSink(a => fork(f(a).run(sink)), sink.error))));
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* @tsplus pipeable fncts.io.Push switchMapIO
|
|
401
|
+
*/
|
|
402
|
+
function switchMapIO_1(f) {
|
|
403
|
+
return self => {
|
|
404
|
+
return switchMap_1(a => fromIO_1(() => f(a)))(self);
|
|
405
|
+
};
|
|
352
406
|
}
|
|
353
407
|
/**
|
|
354
|
-
* @tsplus pipeable fncts.io.
|
|
408
|
+
* @tsplus pipeable fncts.io.Push tap
|
|
355
409
|
*/
|
|
356
|
-
export function
|
|
410
|
+
export function tap(f) {
|
|
357
411
|
return self => {
|
|
358
|
-
return
|
|
359
|
-
const innerEmitter = tsplus_module_2.makeEmitter(value => emitter.emit(value), cause => tsplus_module_1.zipRight(emitter.failCause(cause), fileName_1 + ":572:41")(tsplus_module_31.set(null, fileName_1 + ":572:33")(current)), latch.countDown);
|
|
360
|
-
return tsplus_module_1.flatMap(() => tsplus_module_1.map(() => void 0, fileName_1 + ":587:10")(tsplus_module_1.zipRight(emitter.end, fileName_1 + ":587:24")(latch.await)), fileName_1 + ":575:10")(self.run(tsplus_module_2.makeEmitter(value => tsplus_module_9.updateIO(fiber => tsplus_module_1.zipRight(tsplus_module_3.forkScoped(f(value).run(innerEmitter), fileName_1 + ":580:98"), fileName_1 + ":580:71")(fiber ? tsplus_module_8.interrupt(fiber) : latch.increment), fileName_1 + ":579:33")(current), cause => emitter.failCause(cause), latch.countDown)));
|
|
361
|
-
}, fileName_1 + ":569:31")(tsplus_module_4.make(1)), fileName_1 + ":568:31")(tsplus_module_10.makeSynchronized(() => null, fileName_1 + ":568:53")));
|
|
412
|
+
return tsplus_module_11.makePush(sink => self.run(tsplus_module_11.makeSink(a => tsplus_module_4.matchCauseIO(sink.error, () => sink.event(a), fileName_1 + ":585:65")(f(a)), sink.error)));
|
|
362
413
|
};
|
|
363
414
|
}
|
|
364
415
|
/**
|
|
365
416
|
* @tsplus pipeable fncts.io.Push transform
|
|
366
417
|
*/
|
|
367
418
|
function transform_1(f) {
|
|
368
|
-
return self =>
|
|
419
|
+
return self => tsplus_module_11.makePush(emitter => f(self.run(emitter)));
|
|
369
420
|
}
|
|
370
421
|
function unfoldLoop(s, f, emitter) {
|
|
371
|
-
return
|
|
422
|
+
return tsplus_module_16.match(() => tsplus_module_4.unit, ([a, s]) => tsplus_module_4.zipRight(unfoldLoop(s, f, emitter), fileName_1 + ":603:35")(emitter.event(a)))(f(s));
|
|
372
423
|
}
|
|
373
424
|
/**
|
|
374
425
|
* @tsplus static fncts.io.PushOps unfold
|
|
375
426
|
*/
|
|
376
427
|
export function unfold(s, f) {
|
|
377
|
-
return
|
|
428
|
+
return tsplus_module_11.makePush(emitter => unfoldLoop(s, f, emitter));
|
|
378
429
|
}
|
|
379
430
|
function unfoldIOLoop(s, f, emitter) {
|
|
380
|
-
return
|
|
431
|
+
return tsplus_module_4.catchAllCause(cause => emitter.error(cause), fileName_1 + ":626:19")(tsplus_module_4.flatMap(result => tsplus_module_16.match(() => tsplus_module_4.unit, ([a, s]) => tsplus_module_4.zipRight(unfoldIOLoop(s, f, emitter), fileName_1 + ":623:39")(emitter.event(a)))(result), fileName_1 + ":620:13")(f(s)));
|
|
381
432
|
}
|
|
382
433
|
/**
|
|
383
434
|
* @tsplus static fncts.io.PushOps unfoldIO
|
|
384
435
|
*/
|
|
385
436
|
function unfoldIO_1(s, f) {
|
|
386
|
-
return
|
|
437
|
+
return tsplus_module_11.makePush(emitter => unfoldIOLoop(s, f, emitter));
|
|
387
438
|
}
|
|
388
439
|
/**
|
|
389
440
|
* @tsplus pipeable fncts.io.Push untilFuture
|
|
390
441
|
*/
|
|
391
442
|
export function untilFuture(future) {
|
|
392
443
|
return self => {
|
|
393
|
-
return
|
|
444
|
+
return tsplus_module_11.makePush(sink => tsplus_module_20.asyncIO(cb => {
|
|
445
|
+
const exit = tsplus_module_4.succeed(() => cb(tsplus_module_4.unit), fileName_1 + ":643:24");
|
|
446
|
+
return tsplus_module_4.flatMap(streamFiber => tsplus_module_4.flatMap(futureFiber => tsplus_module_4.map(() => void 0, fileName_1 + ":654:12")(tsplus_module_31.joinAll([streamFiber, futureFiber], fileName_1 + ":654:26")), fileName_1 + ":646:32")(tsplus_module_32.fork(tsplus_module_4.zipRight(exit, fileName_1 + ":652:24")(tsplus_module_4.matchCauseIO(cause => sink.error(cause), () => tsplus_module_4.unit, fileName_1 + ":648:28")(tsplus_module_1.wait(future, fileName_1 + ":647:19"))), fileName_1 + ":652:30")), fileName_1 + ":645:32")(tsplus_module_32.fork(self.run(sink), fileName_1 + ":645:47"));
|
|
447
|
+
}, fileName_1 + ":642:17"));
|
|
394
448
|
};
|
|
395
449
|
}
|
|
396
450
|
/**
|
|
@@ -398,7 +452,10 @@ export function untilFuture(future) {
|
|
|
398
452
|
*/
|
|
399
453
|
export function untilPush(signal) {
|
|
400
454
|
return self => {
|
|
401
|
-
return
|
|
455
|
+
return tsplus_module_11.makePush(sink => tsplus_module_20.asyncIO(cb => {
|
|
456
|
+
const exit = tsplus_module_4.succeed(() => cb(tsplus_module_4.unit), fileName_1 + ":668:24");
|
|
457
|
+
return tsplus_module_4.flatMap(signalFiber => tsplus_module_4.flatMap(streamFiber => tsplus_module_4.map(() => void 0, fileName_1 + ":679:12")(tsplus_module_31.joinAll([signalFiber, streamFiber], fileName_1 + ":679:26")), fileName_1 + ":678:32")(tsplus_module_32.fork(self.run(sink), fileName_1 + ":678:47")), fileName_1 + ":670:32")(tsplus_module_32.fork(signal.run(tsplus_module_11.makeSink(() => exit, cause => sink.error(cause))), fileName_1 + ":676:14"));
|
|
458
|
+
}, fileName_1 + ":667:17"));
|
|
402
459
|
};
|
|
403
460
|
}
|
|
404
461
|
/**
|