@effect/platform-node 4.0.0-beta.8 → 4.0.0-beta.80
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/dist/Mime.d.ts +9 -3
- package/dist/Mime.d.ts.map +1 -1
- package/dist/Mime.js +9 -3
- package/dist/Mime.js.map +1 -1
- package/dist/NodeChildProcessSpawner.d.ts +1 -1
- package/dist/NodeChildProcessSpawner.js +1 -1
- package/dist/NodeClusterHttp.d.ts +25 -7
- package/dist/NodeClusterHttp.d.ts.map +1 -1
- package/dist/NodeClusterHttp.js +20 -10
- package/dist/NodeClusterHttp.js.map +1 -1
- package/dist/NodeClusterSocket.d.ts +37 -11
- package/dist/NodeClusterSocket.d.ts.map +1 -1
- package/dist/NodeClusterSocket.js +37 -11
- package/dist/NodeClusterSocket.js.map +1 -1
- package/dist/NodeCrypto.d.ts +10 -0
- package/dist/NodeCrypto.d.ts.map +1 -0
- package/dist/NodeCrypto.js +22 -0
- package/dist/NodeCrypto.js.map +1 -0
- package/dist/NodeFileSystem.d.ts +4 -2
- package/dist/NodeFileSystem.d.ts.map +1 -1
- package/dist/NodeFileSystem.js +12 -3
- package/dist/NodeFileSystem.js.map +1 -1
- package/dist/NodeHttpClient.d.ts +98 -29
- package/dist/NodeHttpClient.d.ts.map +1 -1
- package/dist/NodeHttpClient.js +120 -33
- package/dist/NodeHttpClient.js.map +1 -1
- package/dist/NodeHttpIncomingMessage.d.ts +36 -9
- package/dist/NodeHttpIncomingMessage.d.ts.map +1 -1
- package/dist/NodeHttpIncomingMessage.js +40 -8
- package/dist/NodeHttpIncomingMessage.js.map +1 -1
- package/dist/NodeHttpPlatform.d.ts +10 -4
- package/dist/NodeHttpPlatform.d.ts.map +1 -1
- package/dist/NodeHttpPlatform.js +20 -7
- package/dist/NodeHttpPlatform.js.map +1 -1
- package/dist/NodeHttpServer.d.ts +59 -19
- package/dist/NodeHttpServer.d.ts.map +1 -1
- package/dist/NodeHttpServer.js +102 -52
- package/dist/NodeHttpServer.js.map +1 -1
- package/dist/NodeHttpServerRequest.d.ts +18 -5
- package/dist/NodeHttpServerRequest.d.ts.map +1 -1
- package/dist/NodeHttpServerRequest.js +11 -4
- package/dist/NodeHttpServerRequest.js.map +1 -1
- package/dist/NodeMultipart.d.ts +24 -4
- package/dist/NodeMultipart.d.ts.map +1 -1
- package/dist/NodeMultipart.js +24 -4
- package/dist/NodeMultipart.js.map +1 -1
- package/dist/NodePath.d.ts +15 -6
- package/dist/NodePath.d.ts.map +1 -1
- package/dist/NodePath.js +23 -7
- package/dist/NodePath.js.map +1 -1
- package/dist/NodeRedis.d.ts +27 -9
- package/dist/NodeRedis.d.ts.map +1 -1
- package/dist/NodeRedis.js +30 -12
- package/dist/NodeRedis.js.map +1 -1
- package/dist/NodeRuntime.d.ts +27 -36
- package/dist/NodeRuntime.d.ts.map +1 -1
- package/dist/NodeRuntime.js +17 -13
- package/dist/NodeRuntime.js.map +1 -1
- package/dist/NodeServices.d.ts +19 -5
- package/dist/NodeServices.d.ts.map +1 -1
- package/dist/NodeServices.js +7 -3
- package/dist/NodeServices.js.map +1 -1
- package/dist/NodeSink.d.ts +2 -2
- package/dist/NodeSink.js +2 -2
- package/dist/NodeSocket.d.ts +18 -3
- package/dist/NodeSocket.d.ts.map +1 -1
- package/dist/NodeSocket.js +27 -4
- package/dist/NodeSocket.js.map +1 -1
- package/dist/NodeSocketServer.d.ts +2 -2
- package/dist/NodeSocketServer.js +2 -2
- package/dist/NodeStdio.d.ts +5 -2
- package/dist/NodeStdio.d.ts.map +1 -1
- package/dist/NodeStdio.js +13 -3
- package/dist/NodeStdio.js.map +1 -1
- package/dist/NodeStream.d.ts +2 -2
- package/dist/NodeStream.js +2 -2
- package/dist/NodeTerminal.d.ts +8 -2
- package/dist/NodeTerminal.d.ts.map +1 -1
- package/dist/NodeTerminal.js +15 -3
- package/dist/NodeTerminal.js.map +1 -1
- package/dist/NodeWorker.d.ts +9 -2
- package/dist/NodeWorker.d.ts.map +1 -1
- package/dist/NodeWorker.js +22 -6
- package/dist/NodeWorker.js.map +1 -1
- package/dist/NodeWorkerRunner.d.ts +5 -1
- package/dist/NodeWorkerRunner.d.ts.map +1 -1
- package/dist/NodeWorkerRunner.js +18 -5
- package/dist/NodeWorkerRunner.js.map +1 -1
- package/dist/Undici.d.ts +18 -5
- package/dist/Undici.d.ts.map +1 -1
- package/dist/Undici.js +18 -5
- package/dist/Undici.js.map +1 -1
- package/dist/index.d.ts +28 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -26
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/src/Mime.ts +10 -3
- package/src/NodeChildProcessSpawner.ts +1 -1
- package/src/NodeClusterHttp.ts +30 -11
- package/src/NodeClusterSocket.ts +37 -11
- package/src/NodeCrypto.ts +24 -0
- package/src/NodeFileSystem.ts +12 -3
- package/src/NodeHttpClient.ts +128 -38
- package/src/NodeHttpIncomingMessage.ts +48 -12
- package/src/NodeHttpPlatform.ts +21 -6
- package/src/NodeHttpServer.ts +124 -56
- package/src/NodeHttpServerRequest.ts +18 -5
- package/src/NodeMultipart.ts +24 -4
- package/src/NodePath.ts +23 -7
- package/src/NodeRedis.ts +32 -14
- package/src/NodeRuntime.ts +35 -37
- package/src/NodeServices.ts +21 -5
- package/src/NodeSink.ts +2 -2
- package/src/NodeSocket.ts +32 -4
- package/src/NodeSocketServer.ts +2 -2
- package/src/NodeStdio.ts +13 -3
- package/src/NodeStream.ts +2 -2
- package/src/NodeTerminal.ts +15 -3
- package/src/NodeWorker.ts +22 -6
- package/src/NodeWorkerRunner.ts +18 -5
- package/src/Undici.ts +18 -5
- package/src/index.ts +29 -26
package/dist/NodeRuntime.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ import type * as Runtime from "effect/Runtime";
|
|
|
3
3
|
/**
|
|
4
4
|
* Helps you run a main effect with built-in error handling, logging, and signal management.
|
|
5
5
|
*
|
|
6
|
+
* **When to use**
|
|
7
|
+
*
|
|
8
|
+
* Use to run a Node.js application's main Effect with structured error
|
|
9
|
+
* handling, log management, interrupt support, or advanced teardown
|
|
10
|
+
* capabilities.
|
|
11
|
+
*
|
|
6
12
|
* **Details**
|
|
7
13
|
*
|
|
8
14
|
* This function launches an Effect as the main entry point, setting exit codes
|
|
@@ -11,26 +17,23 @@ import type * as Runtime from "effect/Runtime";
|
|
|
11
17
|
* behaviors can be turned off. You can also provide custom teardown logic to
|
|
12
18
|
* finalize resources or produce different exit codes.
|
|
13
19
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* An optional object that can include:
|
|
20
|
+
* The optional configuration object can include:
|
|
17
21
|
* - `disableErrorReporting`: Turn off automatic error logging.
|
|
18
|
-
* - `disablePrettyLogger`: Avoid adding the pretty logger.
|
|
19
22
|
* - `teardown`: Provide custom finalization logic.
|
|
20
23
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Use this function to run an Effect as your application’s main program, especially
|
|
24
|
-
* when you need structured error handling, log management, interrupt support,
|
|
25
|
-
* or advanced teardown capabilities.
|
|
26
|
-
*
|
|
27
|
-
* @since 1.0.0
|
|
28
|
-
* @category Run main
|
|
24
|
+
* @category running
|
|
25
|
+
* @since 4.0.0
|
|
29
26
|
*/
|
|
30
27
|
export declare const runMain: {
|
|
31
28
|
/**
|
|
32
29
|
* Helps you run a main effect with built-in error handling, logging, and signal management.
|
|
33
30
|
*
|
|
31
|
+
* **When to use**
|
|
32
|
+
*
|
|
33
|
+
* Use to run a Node.js application's main Effect with structured error
|
|
34
|
+
* handling, log management, interrupt support, or advanced teardown
|
|
35
|
+
* capabilities.
|
|
36
|
+
*
|
|
34
37
|
* **Details**
|
|
35
38
|
*
|
|
36
39
|
* This function launches an Effect as the main entry point, setting exit codes
|
|
@@ -39,21 +42,12 @@ export declare const runMain: {
|
|
|
39
42
|
* behaviors can be turned off. You can also provide custom teardown logic to
|
|
40
43
|
* finalize resources or produce different exit codes.
|
|
41
44
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* An optional object that can include:
|
|
45
|
+
* The optional configuration object can include:
|
|
45
46
|
* - `disableErrorReporting`: Turn off automatic error logging.
|
|
46
|
-
* - `disablePrettyLogger`: Avoid adding the pretty logger.
|
|
47
47
|
* - `teardown`: Provide custom finalization logic.
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* Use this function to run an Effect as your application’s main program, especially
|
|
52
|
-
* when you need structured error handling, log management, interrupt support,
|
|
53
|
-
* or advanced teardown capabilities.
|
|
54
|
-
*
|
|
55
|
-
* @since 1.0.0
|
|
56
|
-
* @category Run main
|
|
49
|
+
* @category running
|
|
50
|
+
* @since 4.0.0
|
|
57
51
|
*/
|
|
58
52
|
(options?: {
|
|
59
53
|
readonly disableErrorReporting?: boolean | undefined;
|
|
@@ -62,6 +56,12 @@ export declare const runMain: {
|
|
|
62
56
|
/**
|
|
63
57
|
* Helps you run a main effect with built-in error handling, logging, and signal management.
|
|
64
58
|
*
|
|
59
|
+
* **When to use**
|
|
60
|
+
*
|
|
61
|
+
* Use to run a Node.js application's main Effect with structured error
|
|
62
|
+
* handling, log management, interrupt support, or advanced teardown
|
|
63
|
+
* capabilities.
|
|
64
|
+
*
|
|
65
65
|
* **Details**
|
|
66
66
|
*
|
|
67
67
|
* This function launches an Effect as the main entry point, setting exit codes
|
|
@@ -70,21 +70,12 @@ export declare const runMain: {
|
|
|
70
70
|
* behaviors can be turned off. You can also provide custom teardown logic to
|
|
71
71
|
* finalize resources or produce different exit codes.
|
|
72
72
|
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* An optional object that can include:
|
|
73
|
+
* The optional configuration object can include:
|
|
76
74
|
* - `disableErrorReporting`: Turn off automatic error logging.
|
|
77
|
-
* - `disablePrettyLogger`: Avoid adding the pretty logger.
|
|
78
75
|
* - `teardown`: Provide custom finalization logic.
|
|
79
76
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* Use this function to run an Effect as your application’s main program, especially
|
|
83
|
-
* when you need structured error handling, log management, interrupt support,
|
|
84
|
-
* or advanced teardown capabilities.
|
|
85
|
-
*
|
|
86
|
-
* @since 1.0.0
|
|
87
|
-
* @category Run main
|
|
77
|
+
* @category running
|
|
78
|
+
* @since 4.0.0
|
|
88
79
|
*/
|
|
89
80
|
<E, A>(effect: Effect<A, E>, options?: {
|
|
90
81
|
readonly disableErrorReporting?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRuntime.d.ts","sourceRoot":"","sources":["../src/NodeRuntime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeRuntime.d.ts","sourceRoot":"","sources":["../src/NodeRuntime.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,OAAO,EAAE;IACpB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,CACE,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAA;KACjD,GACA,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAA;IACvC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,CAAC,CAAC,EAAE,CAAC,EACH,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAA;KACjD,GACA,IAAI,CAAA;CACc,CAAA"}
|
package/dist/NodeRuntime.js
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js process runner for Effect programs.
|
|
3
|
+
*
|
|
4
|
+
* This module exports `runMain`, which runs one Effect as the main process
|
|
5
|
+
* fiber in Node.js. It reuses the shared Node runtime runner, including its
|
|
6
|
+
* error reporting, `SIGINT` / `SIGTERM` interruption, and optional teardown
|
|
7
|
+
* behavior.
|
|
8
|
+
*
|
|
9
|
+
* @since 4.0.0
|
|
3
10
|
*/
|
|
4
11
|
import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
|
|
5
12
|
/**
|
|
6
13
|
* Helps you run a main effect with built-in error handling, logging, and signal management.
|
|
7
14
|
*
|
|
15
|
+
* **When to use**
|
|
16
|
+
*
|
|
17
|
+
* Use to run a Node.js application's main Effect with structured error
|
|
18
|
+
* handling, log management, interrupt support, or advanced teardown
|
|
19
|
+
* capabilities.
|
|
20
|
+
*
|
|
8
21
|
* **Details**
|
|
9
22
|
*
|
|
10
23
|
* This function launches an Effect as the main entry point, setting exit codes
|
|
@@ -13,21 +26,12 @@ import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
|
|
|
13
26
|
* behaviors can be turned off. You can also provide custom teardown logic to
|
|
14
27
|
* finalize resources or produce different exit codes.
|
|
15
28
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* An optional object that can include:
|
|
29
|
+
* The optional configuration object can include:
|
|
19
30
|
* - `disableErrorReporting`: Turn off automatic error logging.
|
|
20
|
-
* - `disablePrettyLogger`: Avoid adding the pretty logger.
|
|
21
31
|
* - `teardown`: Provide custom finalization logic.
|
|
22
32
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* Use this function to run an Effect as your application’s main program, especially
|
|
26
|
-
* when you need structured error handling, log management, interrupt support,
|
|
27
|
-
* or advanced teardown capabilities.
|
|
28
|
-
*
|
|
29
|
-
* @since 1.0.0
|
|
30
|
-
* @category Run main
|
|
33
|
+
* @category running
|
|
34
|
+
* @since 4.0.0
|
|
31
35
|
*/
|
|
32
36
|
export const runMain = NodeRuntime.runMain;
|
|
33
37
|
//# sourceMappingURL=NodeRuntime.js.map
|
package/dist/NodeRuntime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRuntime.js","names":["NodeRuntime","runMain"],"sources":["../src/NodeRuntime.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeRuntime.js","names":["NodeRuntime","runMain"],"sources":["../src/NodeRuntime.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;AAUA,OAAO,KAAKA,WAAW,MAAM,0CAA0C;AAIvE;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,MAAMC,OAAO,GA8DhBD,WAAW,CAACC,OAAO","ignoreList":[]}
|
package/dist/NodeServices.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Aggregate Node.js platform services layer.
|
|
3
|
+
*
|
|
4
|
+
* This module defines the `NodeServices` union and a single `layer` that
|
|
5
|
+
* provides Node-backed child process spawning, crypto, filesystem, path, stdio,
|
|
6
|
+
* and terminal services. Use the layer when a Node program wants the standard
|
|
7
|
+
* platform services from one place.
|
|
8
|
+
*
|
|
9
|
+
* @since 4.0.0
|
|
3
10
|
*/
|
|
11
|
+
import type { Crypto } from "effect/Crypto";
|
|
4
12
|
import type { FileSystem } from "effect/FileSystem";
|
|
5
13
|
import * as Layer from "effect/Layer";
|
|
6
14
|
import type { Path } from "effect/Path";
|
|
@@ -8,13 +16,19 @@ import type { Stdio } from "effect/Stdio";
|
|
|
8
16
|
import type { Terminal } from "effect/Terminal";
|
|
9
17
|
import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
|
|
10
18
|
/**
|
|
11
|
-
*
|
|
19
|
+
* The union of core services provided by the Node platform layer, including
|
|
20
|
+
* child process spawning, filesystem, path, stdio, and terminal services.
|
|
21
|
+
*
|
|
12
22
|
* @category models
|
|
23
|
+
* @since 4.0.0
|
|
13
24
|
*/
|
|
14
|
-
export type NodeServices = ChildProcessSpawner | FileSystem | Path | Stdio | Terminal;
|
|
25
|
+
export type NodeServices = ChildProcessSpawner | Crypto | FileSystem | Path | Stdio | Terminal;
|
|
15
26
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
27
|
+
* Provides the default Node implementations for child process spawning,
|
|
28
|
+
* filesystem, path, stdio, and terminal services.
|
|
29
|
+
*
|
|
30
|
+
* @category layers
|
|
31
|
+
* @since 4.0.0
|
|
18
32
|
*/
|
|
19
33
|
export declare const layer: Layer.Layer<NodeServices>;
|
|
20
34
|
//# sourceMappingURL=NodeServices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeServices.d.ts","sourceRoot":"","sources":["../src/NodeServices.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeServices.d.ts","sourceRoot":"","sources":["../src/NodeServices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AAQtF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE9F;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAS3C,CAAA"}
|
package/dist/NodeServices.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import * as Layer from "effect/Layer";
|
|
2
2
|
import * as NodeChildProcessSpawner from "./NodeChildProcessSpawner.js";
|
|
3
|
+
import * as NodeCrypto from "./NodeCrypto.js";
|
|
3
4
|
import * as NodeFileSystem from "./NodeFileSystem.js";
|
|
4
5
|
import * as NodePath from "./NodePath.js";
|
|
5
6
|
import * as NodeStdio from "./NodeStdio.js";
|
|
6
7
|
import * as NodeTerminal from "./NodeTerminal.js";
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* Provides the default Node implementations for child process spawning,
|
|
10
|
+
* filesystem, path, stdio, and terminal services.
|
|
11
|
+
*
|
|
12
|
+
* @category layers
|
|
13
|
+
* @since 4.0.0
|
|
10
14
|
*/
|
|
11
|
-
export const layer = /*#__PURE__*/Layer.provideMerge(NodeChildProcessSpawner.layer, /*#__PURE__*/Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeStdio.layer, NodeTerminal.layer));
|
|
15
|
+
export const layer = /*#__PURE__*/Layer.provideMerge(NodeChildProcessSpawner.layer, /*#__PURE__*/Layer.mergeAll(NodeFileSystem.layer, NodeCrypto.layer, NodePath.layer, NodeStdio.layer, NodeTerminal.layer));
|
|
12
16
|
//# sourceMappingURL=NodeServices.js.map
|
package/dist/NodeServices.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeServices.js","names":["Layer","NodeChildProcessSpawner","NodeFileSystem","NodePath","NodeStdio","NodeTerminal","layer","provideMerge","mergeAll"],"sources":["../src/NodeServices.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeServices.js","names":["Layer","NodeChildProcessSpawner","NodeCrypto","NodeFileSystem","NodePath","NodeStdio","NodeTerminal","layer","provideMerge","mergeAll"],"sources":["../src/NodeServices.ts"],"sourcesContent":[null],"mappings":"AAYA,OAAO,KAAKA,KAAK,MAAM,cAAc;AAKrC,OAAO,KAAKC,uBAAuB,MAAM,8BAA8B;AACvE,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAC7C,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AACrD,OAAO,KAAKC,QAAQ,MAAM,eAAe;AACzC,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAC3C,OAAO,KAAKC,YAAY,MAAM,mBAAmB;AAWjD;;;;;;;AAOA,OAAO,MAAMC,KAAK,gBAA8BP,KAAK,CAACQ,YAAY,CAChEP,uBAAuB,CAACM,KAAK,eAC7BP,KAAK,CAACS,QAAQ,CACZN,cAAc,CAACI,KAAK,EACpBL,UAAU,CAACK,KAAK,EAChBH,QAAQ,CAACG,KAAK,EACdF,SAAS,CAACE,KAAK,EACfD,YAAY,CAACC,KAAK,CACnB,CACF","ignoreList":[]}
|
package/dist/NodeSink.d.ts
CHANGED
package/dist/NodeSink.js
CHANGED
package/dist/NodeSocket.d.ts
CHANGED
|
@@ -3,17 +3,32 @@ import type * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import * as Socket from "effect/unstable/socket/Socket";
|
|
5
5
|
/**
|
|
6
|
-
* @since
|
|
6
|
+
* @since 4.0.0
|
|
7
7
|
*/
|
|
8
8
|
export * from "@effect/platform-node-shared/NodeSocket";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Provides a `Socket.WebSocketConstructor`, using `globalThis.WebSocket` when
|
|
11
|
+
* available and falling back to the `ws` package otherwise.
|
|
12
|
+
*
|
|
11
13
|
* @category layers
|
|
14
|
+
* @since 4.0.0
|
|
12
15
|
*/
|
|
13
16
|
export declare const layerWebSocketConstructor: Layer.Layer<Socket.WebSocketConstructor>;
|
|
14
17
|
/**
|
|
15
|
-
*
|
|
18
|
+
* Provides a `Socket.WebSocketConstructor` backed explicitly by the `ws`
|
|
19
|
+
* package.
|
|
20
|
+
*
|
|
16
21
|
* @category layers
|
|
22
|
+
* @since 4.0.0
|
|
23
|
+
*/
|
|
24
|
+
export declare const layerWebSocketConstructorWS: Layer.Layer<Socket.WebSocketConstructor>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a `Socket.Socket` layer for a WebSocket URL using the Node WebSocket
|
|
27
|
+
* constructor layer, honoring protocol, open-timeout, and close-code error
|
|
28
|
+
* options.
|
|
29
|
+
*
|
|
30
|
+
* @category layers
|
|
31
|
+
* @since 4.0.0
|
|
17
32
|
*/
|
|
18
33
|
export declare const layerWebSocket: (url: string | Effect.Effect<string>, options?: {
|
|
19
34
|
readonly closeCodeIsError?: ((code: number) => boolean) | undefined;
|
package/dist/NodeSocket.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeSocket.d.ts","sourceRoot":"","sources":["../src/NodeSocket.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeSocket.d.ts","sourceRoot":"","sources":["../src/NodeSocket.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAE5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAA;AAEvD;;GAEG;AACH,cAAc,yCAAyC,CAAA;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,KAAK,CACjD,MAAM,CAAC,oBAAoB,CAM3B,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,KAAK,CACnD,MAAM,CAAC,oBAAoB,CAG5B,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,CAC3B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EACnC,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAAA;IACnE,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAA;IACjD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;CACxD,GAAG,SAAS,KACV,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAI3C,CAAA"}
|
package/dist/NodeSocket.js
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js socket constructors and layers for Effect sockets.
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports the shared Node socket support for TCP connections,
|
|
5
|
+
* Unix domain socket connections, and Node `Duplex` streams. It also provides
|
|
6
|
+
* WebSocket constructor layers: one that uses `globalThis.WebSocket` when
|
|
7
|
+
* present and falls back to `ws`, one that always uses `ws`, and one that
|
|
8
|
+
* creates a `Socket.Socket` layer for a WebSocket URL.
|
|
9
|
+
*
|
|
10
|
+
* @since 4.0.0
|
|
3
11
|
*/
|
|
4
12
|
import { NodeWS as WS } from "@effect/platform-node-shared/NodeSocket";
|
|
5
13
|
import { flow } from "effect/Function";
|
|
6
14
|
import * as Layer from "effect/Layer";
|
|
7
15
|
import * as Socket from "effect/unstable/socket/Socket";
|
|
8
16
|
/**
|
|
9
|
-
* @since
|
|
17
|
+
* @since 4.0.0
|
|
10
18
|
*/
|
|
11
19
|
export * from "@effect/platform-node-shared/NodeSocket";
|
|
12
20
|
/**
|
|
13
|
-
*
|
|
21
|
+
* Provides a `Socket.WebSocketConstructor`, using `globalThis.WebSocket` when
|
|
22
|
+
* available and falling back to the `ws` package otherwise.
|
|
23
|
+
*
|
|
14
24
|
* @category layers
|
|
25
|
+
* @since 4.0.0
|
|
15
26
|
*/
|
|
16
27
|
export const layerWebSocketConstructor = /*#__PURE__*/Layer.sync(Socket.WebSocketConstructor)(() => {
|
|
17
28
|
if ("WebSocket" in globalThis) {
|
|
@@ -20,8 +31,20 @@ export const layerWebSocketConstructor = /*#__PURE__*/Layer.sync(Socket.WebSocke
|
|
|
20
31
|
return (url, protocols) => new WS.WebSocket(url, protocols);
|
|
21
32
|
});
|
|
22
33
|
/**
|
|
23
|
-
*
|
|
34
|
+
* Provides a `Socket.WebSocketConstructor` backed explicitly by the `ws`
|
|
35
|
+
* package.
|
|
36
|
+
*
|
|
24
37
|
* @category layers
|
|
38
|
+
* @since 4.0.0
|
|
39
|
+
*/
|
|
40
|
+
export const layerWebSocketConstructorWS = /*#__PURE__*/Layer.succeed(Socket.WebSocketConstructor)((url, protocols) => new WS.WebSocket(url, protocols));
|
|
41
|
+
/**
|
|
42
|
+
* Creates a `Socket.Socket` layer for a WebSocket URL using the Node WebSocket
|
|
43
|
+
* constructor layer, honoring protocol, open-timeout, and close-code error
|
|
44
|
+
* options.
|
|
45
|
+
*
|
|
46
|
+
* @category layers
|
|
47
|
+
* @since 4.0.0
|
|
25
48
|
*/
|
|
26
49
|
export const layerWebSocket = /*#__PURE__*/flow(Socket.makeWebSocket, /*#__PURE__*/Layer.effect(Socket.Socket), /*#__PURE__*/Layer.provide(layerWebSocketConstructor));
|
|
27
50
|
//# sourceMappingURL=NodeSocket.js.map
|
package/dist/NodeSocket.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeSocket.js","names":["NodeWS","WS","flow","Layer","Socket","layerWebSocketConstructor","sync","WebSocketConstructor","globalThis","url","protocols","WebSocket","layerWebSocket","makeWebSocket","effect","provide"],"sources":["../src/NodeSocket.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeSocket.js","names":["NodeWS","WS","flow","Layer","Socket","layerWebSocketConstructor","sync","WebSocketConstructor","globalThis","url","protocols","WebSocket","layerWebSocketConstructorWS","succeed","layerWebSocket","makeWebSocket","effect","provide"],"sources":["../src/NodeSocket.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,SAASA,MAAM,IAAIC,EAAE,QAAQ,yCAAyC;AAGtE,SAASC,IAAI,QAAQ,iBAAiB;AACtC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,+BAA+B;AAEvD;;;AAGA,cAAc,yCAAyC;AAEvD;;;;;;;AAOA,OAAO,MAAMC,yBAAyB,gBAElCF,KAAK,CAACG,IAAI,CAACF,MAAM,CAACG,oBAAoB,CAAC,CAAC,MAAK;EAC/C,IAAI,WAAW,IAAIC,UAAU,EAAE;IAC7B,OAAO,CAACC,GAAG,EAAEC,SAAS,KAAK,IAAIF,UAAU,CAACG,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAC;EACrE;EACA,OAAO,CAACD,GAAG,EAAEC,SAAS,KAAK,IAAIT,EAAE,CAACU,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAoC;AAChG,CAAC,CAAC;AAEF;;;;;;;AAOA,OAAO,MAAME,2BAA2B,gBAEpCT,KAAK,CAACU,OAAO,CAACT,MAAM,CAACG,oBAAoB,CAAC,CAC5C,CAACE,GAAG,EAAEC,SAAS,KAAK,IAAIT,EAAE,CAACU,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAoC,CACxF;AAED;;;;;;;;AAQA,OAAO,MAAMI,cAAc,gBAOqBZ,IAAI,CAClDE,MAAM,CAACW,aAAa,eACpBZ,KAAK,CAACa,MAAM,CAACZ,MAAM,CAACA,MAAM,CAAC,eAC3BD,KAAK,CAACc,OAAO,CAACZ,yBAAyB,CAAC,CACzC","ignoreList":[]}
|
package/dist/NodeSocketServer.js
CHANGED
package/dist/NodeStdio.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type * as Layer from "effect/Layer";
|
|
2
2
|
import type { Stdio } from "effect/Stdio";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Provides the `Stdio` service backed by the current process arguments,
|
|
5
|
+
* stdin, stdout, and stderr streams.
|
|
6
|
+
*
|
|
7
|
+
* @category layers
|
|
8
|
+
* @since 4.0.0
|
|
6
9
|
*/
|
|
7
10
|
export declare const layer: Layer.Layer<Stdio>;
|
|
8
11
|
//# sourceMappingURL=NodeStdio.d.ts.map
|
package/dist/NodeStdio.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeStdio.d.ts","sourceRoot":"","sources":["../src/NodeStdio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeStdio.d.ts","sourceRoot":"","sources":["../src/NodeStdio.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAmB,CAAA"}
|
package/dist/NodeStdio.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js `Stdio` layer for the current process.
|
|
3
|
+
*
|
|
4
|
+
* The exported layer reuses the shared Node stdio implementation. It satisfies
|
|
5
|
+
* the platform-independent `Stdio` service by reading command-line arguments
|
|
6
|
+
* from `process.argv`, consuming input from `process.stdin`, and writing output
|
|
7
|
+
* streams to `process.stdout` and `process.stderr`.
|
|
8
|
+
*
|
|
9
|
+
* @since 4.0.0
|
|
3
10
|
*/
|
|
4
11
|
import * as NodeStdio from "@effect/platform-node-shared/NodeStdio";
|
|
5
12
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
13
|
+
* Provides the `Stdio` service backed by the current process arguments,
|
|
14
|
+
* stdin, stdout, and stderr streams.
|
|
15
|
+
*
|
|
16
|
+
* @category layers
|
|
17
|
+
* @since 4.0.0
|
|
8
18
|
*/
|
|
9
19
|
export const layer = NodeStdio.layer;
|
|
10
20
|
//# sourceMappingURL=NodeStdio.js.map
|
package/dist/NodeStdio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeStdio.js","names":["NodeStdio","layer"],"sources":["../src/NodeStdio.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeStdio.js","names":["NodeStdio","layer"],"sources":["../src/NodeStdio.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;AAUA,OAAO,KAAKA,SAAS,MAAM,wCAAwC;AAInE;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAuBD,SAAS,CAACC,KAAK","ignoreList":[]}
|
package/dist/NodeStream.d.ts
CHANGED
package/dist/NodeStream.js
CHANGED
package/dist/NodeTerminal.d.ts
CHANGED
|
@@ -3,13 +3,19 @@ import type { Layer } from "effect/Layer";
|
|
|
3
3
|
import type { Scope } from "effect/Scope";
|
|
4
4
|
import type { Terminal, UserInput } from "effect/Terminal";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Creates a scoped `Terminal` service backed by process stdin/stdout, using the
|
|
7
|
+
* optional predicate to decide when key input should end the input stream.
|
|
8
|
+
*
|
|
7
9
|
* @category constructors
|
|
10
|
+
* @since 4.0.0
|
|
8
11
|
*/
|
|
9
12
|
export declare const make: (shouldQuit?: (input: UserInput) => boolean) => Effect<Terminal, never, Scope>;
|
|
10
13
|
/**
|
|
11
|
-
*
|
|
14
|
+
* Provides the default process-backed `Terminal` service, ending key input on
|
|
15
|
+
* the default quit keys.
|
|
16
|
+
*
|
|
12
17
|
* @category layers
|
|
18
|
+
* @since 4.0.0
|
|
13
19
|
*/
|
|
14
20
|
export declare const layer: Layer<Terminal>;
|
|
15
21
|
//# sourceMappingURL=NodeTerminal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTerminal.d.ts","sourceRoot":"","sources":["../src/NodeTerminal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeTerminal.d.ts","sourceRoot":"","sources":["../src/NodeTerminal.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAqB,CAAA;AAErH;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAsB,CAAA"}
|
package/dist/NodeTerminal.js
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js implementation of the Effect `Terminal` service.
|
|
3
|
+
*
|
|
4
|
+
* This module reuses the shared Node terminal implementation. `make` creates a
|
|
5
|
+
* scoped process-backed `Terminal` service, and `layer` provides the default
|
|
6
|
+
* service with the standard quit behavior for key input.
|
|
7
|
+
*
|
|
8
|
+
* @since 4.0.0
|
|
3
9
|
*/
|
|
4
10
|
import * as NodeTerminal from "@effect/platform-node-shared/NodeTerminal";
|
|
5
11
|
/**
|
|
6
|
-
*
|
|
12
|
+
* Creates a scoped `Terminal` service backed by process stdin/stdout, using the
|
|
13
|
+
* optional predicate to decide when key input should end the input stream.
|
|
14
|
+
*
|
|
7
15
|
* @category constructors
|
|
16
|
+
* @since 4.0.0
|
|
8
17
|
*/
|
|
9
18
|
export const make = NodeTerminal.make;
|
|
10
19
|
/**
|
|
11
|
-
*
|
|
20
|
+
* Provides the default process-backed `Terminal` service, ending key input on
|
|
21
|
+
* the default quit keys.
|
|
22
|
+
*
|
|
12
23
|
* @category layers
|
|
24
|
+
* @since 4.0.0
|
|
13
25
|
*/
|
|
14
26
|
export const layer = NodeTerminal.layer;
|
|
15
27
|
//# sourceMappingURL=NodeTerminal.js.map
|
package/dist/NodeTerminal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTerminal.js","names":["NodeTerminal","make","layer"],"sources":["../src/NodeTerminal.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeTerminal.js","names":["NodeTerminal","make","layer"],"sources":["../src/NodeTerminal.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;AASA,OAAO,KAAKA,YAAY,MAAM,2CAA2C;AAMzE;;;;;;;AAOA,OAAO,MAAMC,IAAI,GAAmFD,YAAY,CAACC,IAAI;AAErH;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAoBF,YAAY,CAACE,KAAK","ignoreList":[]}
|
package/dist/NodeWorker.d.ts
CHANGED
|
@@ -3,13 +3,20 @@ import * as Worker from "effect/unstable/workers/Worker";
|
|
|
3
3
|
import type * as ChildProcess from "node:child_process";
|
|
4
4
|
import type * as WorkerThreads from "node:worker_threads";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Provides the Node `WorkerPlatform` for `worker_threads` workers and child
|
|
7
|
+
* process workers, wiring messages, errors, and exits into Effect workers and
|
|
8
|
+
* terminating the worker if graceful shutdown times out.
|
|
9
|
+
*
|
|
7
10
|
* @category layers
|
|
11
|
+
* @since 4.0.0
|
|
8
12
|
*/
|
|
9
13
|
export declare const layerPlatform: Layer.Layer<Worker.WorkerPlatform>;
|
|
10
14
|
/**
|
|
11
|
-
*
|
|
15
|
+
* Provides the Node `WorkerPlatform` together with a `Worker.Spawner` created
|
|
16
|
+
* from the supplied worker or child-process spawning function.
|
|
17
|
+
*
|
|
12
18
|
* @category layers
|
|
19
|
+
* @since 4.0.0
|
|
13
20
|
*/
|
|
14
21
|
export declare const layer: (spawn: (id: number) => WorkerThreads.Worker | ChildProcess.ChildProcess) => Layer.Layer<Worker.WorkerPlatform | Worker.Spawner>;
|
|
15
22
|
//# sourceMappingURL=NodeWorker.d.ts.map
|
package/dist/NodeWorker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeWorker.d.ts","sourceRoot":"","sources":["../src/NodeWorker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeWorker.d.ts","sourceRoot":"","sources":["../src/NodeWorker.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAA;AAExD,OAAO,KAAK,KAAK,YAAY,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,KAAK,aAAa,MAAM,qBAAqB,CAAA;AAEzD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CA2E5D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAChB,OAAO,CAAC,EAAE,EAAE,MAAM,KAAK,aAAa,CAAC,MAAM,GAAG,YAAY,CAAC,YAAY,KACtE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,OAAO,CAIlD,CAAA"}
|
package/dist/NodeWorker.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Parent-side Node.js support for Effect workers.
|
|
3
|
+
*
|
|
4
|
+
* `layerPlatform` installs the `WorkerPlatform` used by a Node program that
|
|
5
|
+
* owns workers. It supports both `node:worker_threads` workers and IPC-enabled
|
|
6
|
+
* child processes, routing messages through Effect's worker protocol. `layer`
|
|
7
|
+
* combines that platform with a `Spawner` callback, and the platform asks
|
|
8
|
+
* workers to close on scope finalization before forcefully terminating them on
|
|
9
|
+
* timeout.
|
|
10
|
+
*
|
|
11
|
+
* @since 4.0.0
|
|
3
12
|
*/
|
|
4
13
|
import * as Deferred from "effect/Deferred";
|
|
5
14
|
import * as Effect from "effect/Effect";
|
|
@@ -9,8 +18,12 @@ import * as Scope from "effect/Scope";
|
|
|
9
18
|
import * as Worker from "effect/unstable/workers/Worker";
|
|
10
19
|
import { WorkerError, WorkerReceiveError } from "effect/unstable/workers/WorkerError";
|
|
11
20
|
/**
|
|
12
|
-
*
|
|
21
|
+
* Provides the Node `WorkerPlatform` for `worker_threads` workers and child
|
|
22
|
+
* process workers, wiring messages, errors, and exits into Effect workers and
|
|
23
|
+
* terminating the worker if graceful shutdown times out.
|
|
24
|
+
*
|
|
13
25
|
* @category layers
|
|
26
|
+
* @since 4.0.0
|
|
14
27
|
*/
|
|
15
28
|
export const layerPlatform = /*#__PURE__*/Layer.succeed(Worker.WorkerPlatform)(/*#__PURE__*/Worker.makePlatform()({
|
|
16
29
|
setup({
|
|
@@ -53,7 +66,7 @@ export const layerPlatform = /*#__PURE__*/Layer.succeed(Worker.WorkerPlatform)(/
|
|
|
53
66
|
message: "An messageerror event was emitted",
|
|
54
67
|
cause
|
|
55
68
|
})
|
|
56
|
-
})
|
|
69
|
+
}));
|
|
57
70
|
});
|
|
58
71
|
port.worker.on("error", cause => {
|
|
59
72
|
Deferred.doneUnsafe(deferred, new WorkerError({
|
|
@@ -61,21 +74,24 @@ export const layerPlatform = /*#__PURE__*/Layer.succeed(Worker.WorkerPlatform)(/
|
|
|
61
74
|
message: "An error event was emitted",
|
|
62
75
|
cause
|
|
63
76
|
})
|
|
64
|
-
})
|
|
77
|
+
}));
|
|
65
78
|
});
|
|
66
79
|
port.worker.on("exit", code => {
|
|
67
80
|
Deferred.doneUnsafe(deferred, new WorkerError({
|
|
68
81
|
reason: new WorkerReceiveError({
|
|
69
82
|
message: "The worker has exited with code: " + code
|
|
70
83
|
})
|
|
71
|
-
})
|
|
84
|
+
}));
|
|
72
85
|
});
|
|
73
86
|
return Effect.void;
|
|
74
87
|
}
|
|
75
88
|
}));
|
|
76
89
|
/**
|
|
77
|
-
*
|
|
90
|
+
* Provides the Node `WorkerPlatform` together with a `Worker.Spawner` created
|
|
91
|
+
* from the supplied worker or child-process spawning function.
|
|
92
|
+
*
|
|
78
93
|
* @category layers
|
|
94
|
+
* @since 4.0.0
|
|
79
95
|
*/
|
|
80
96
|
export const layer = spawn => Layer.merge(Worker.layerSpawner(spawn), layerPlatform);
|
|
81
97
|
//# sourceMappingURL=NodeWorker.js.map
|