@effect/platform-node 4.0.0-beta.66 → 4.0.0-beta.68
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 +3 -3
- package/dist/Mime.js +3 -3
- package/dist/NodeChildProcessSpawner.d.ts +1 -1
- package/dist/NodeChildProcessSpawner.js +1 -1
- package/dist/NodeClusterHttp.d.ts +47 -7
- package/dist/NodeClusterHttp.d.ts.map +1 -1
- package/dist/NodeClusterHttp.js +13 -6
- package/dist/NodeClusterHttp.js.map +1 -1
- package/dist/NodeClusterSocket.d.ts +51 -11
- package/dist/NodeClusterSocket.d.ts.map +1 -1
- package/dist/NodeClusterSocket.js +51 -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 +14 -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 +22 -3
- package/dist/NodeFileSystem.js.map +1 -1
- package/dist/NodeHttpClient.d.ts +91 -19
- package/dist/NodeHttpClient.d.ts.map +1 -1
- package/dist/NodeHttpClient.js +91 -19
- package/dist/NodeHttpClient.js.map +1 -1
- package/dist/NodeHttpIncomingMessage.d.ts +22 -4
- package/dist/NodeHttpIncomingMessage.d.ts.map +1 -1
- package/dist/NodeHttpIncomingMessage.js +22 -4
- 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 +32 -5
- package/dist/NodeHttpPlatform.js.map +1 -1
- package/dist/NodeHttpServer.d.ts +39 -12
- package/dist/NodeHttpServer.d.ts.map +1 -1
- package/dist/NodeHttpServer.js +69 -13
- package/dist/NodeHttpServer.js.map +1 -1
- package/dist/NodeHttpServerRequest.d.ts +29 -3
- package/dist/NodeHttpServerRequest.d.ts.map +1 -1
- package/dist/NodeHttpServerRequest.js +9 -2
- package/dist/NodeHttpServerRequest.js.map +1 -1
- package/dist/NodeMultipart.d.ts +32 -4
- package/dist/NodeMultipart.d.ts.map +1 -1
- package/dist/NodeMultipart.js +32 -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 +30 -7
- package/dist/NodePath.js.map +1 -1
- package/dist/NodeRedis.d.ts +36 -7
- package/dist/NodeRedis.d.ts.map +1 -1
- package/dist/NodeRedis.js +36 -7
- package/dist/NodeRedis.js.map +1 -1
- package/dist/NodeRuntime.d.ts +6 -6
- package/dist/NodeRuntime.d.ts.map +1 -1
- package/dist/NodeRuntime.js +17 -3
- package/dist/NodeRuntime.js.map +1 -1
- package/dist/NodeServices.d.ts +29 -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 +14 -4
- package/dist/NodeSocket.d.ts.map +1 -1
- package/dist/NodeSocket.js +32 -5
- 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 +22 -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 +19 -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 +28 -3
- 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 +24 -2
- package/dist/NodeWorkerRunner.js.map +1 -1
- package/dist/Undici.d.ts +3 -3
- package/dist/Undici.js +3 -3
- package/dist/index.d.ts +376 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +376 -24
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/Mime.ts +3 -3
- package/src/NodeChildProcessSpawner.ts +1 -1
- package/src/NodeClusterHttp.ts +47 -7
- package/src/NodeClusterSocket.ts +51 -11
- package/src/NodeCrypto.ts +16 -0
- package/src/NodeFileSystem.ts +22 -3
- package/src/NodeHttpClient.ts +91 -19
- package/src/NodeHttpIncomingMessage.ts +22 -4
- package/src/NodeHttpPlatform.ts +32 -5
- package/src/NodeHttpServer.ts +69 -13
- package/src/NodeHttpServerRequest.ts +29 -3
- package/src/NodeMultipart.ts +32 -4
- package/src/NodePath.ts +30 -7
- package/src/NodeRedis.ts +36 -7
- package/src/NodeRuntime.ts +21 -7
- package/src/NodeServices.ts +31 -5
- package/src/NodeSink.ts +2 -2
- package/src/NodeSocket.ts +32 -5
- package/src/NodeSocketServer.ts +2 -2
- package/src/NodeStdio.ts +22 -3
- package/src/NodeStream.ts +2 -2
- package/src/NodeTerminal.ts +19 -3
- package/src/NodeWorker.ts +28 -3
- package/src/NodeWorkerRunner.ts +24 -2
- package/src/Undici.ts +3 -3
- package/src/index.ts +377 -24
package/dist/NodeStdio.js
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js implementation of the Effect `Stdio` service.
|
|
3
|
+
*
|
|
4
|
+
* This module exposes a layer that connects `Stdio` to the current process:
|
|
5
|
+
* command-line arguments come from `process.argv`, input is read from
|
|
6
|
+
* `process.stdin`, and output and error output write to `process.stdout` and
|
|
7
|
+
* `process.stderr`. It is intended for CLIs, scripts, command runners, and
|
|
8
|
+
* other process-oriented programs that need standard input and output through
|
|
9
|
+
* Effect services.
|
|
10
|
+
*
|
|
11
|
+
* The underlying streams are owned by the Node process. The layer keeps stdin
|
|
12
|
+
* open and does not end stdout or stderr when a stream finishes, which avoids
|
|
13
|
+
* closing global process handles that other code may still use. Be mindful that
|
|
14
|
+
* stdio may be a pipe, file, or TTY, so terminal-specific behavior such as raw
|
|
15
|
+
* mode, echo, colors, and cursor control should be handled with the terminal
|
|
16
|
+
* APIs instead of assuming an interactive console.
|
|
17
|
+
*
|
|
18
|
+
* @since 4.0.0
|
|
3
19
|
*/
|
|
4
20
|
import * as NodeStdio from "@effect/platform-node-shared/NodeStdio";
|
|
5
21
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
22
|
+
* Provides the `Stdio` service backed by the current process arguments,
|
|
23
|
+
* stdin, stdout, and stderr streams.
|
|
24
|
+
*
|
|
25
|
+
* @category layers
|
|
26
|
+
* @since 4.0.0
|
|
8
27
|
*/
|
|
9
28
|
export const layer = NodeStdio.layer;
|
|
10
29
|
//# 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;;;;;;;;;;;;;;;;;;;AAmBA,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":"AAcA,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,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provides the Node.js `Terminal` service for interactive command-line
|
|
3
|
+
* programs, prompts, and tools that need to read lines, react to key presses,
|
|
4
|
+
* write to stdout, or inspect terminal dimensions.
|
|
5
|
+
*
|
|
6
|
+
* The implementation is backed by the current process' stdin and stdout. When
|
|
7
|
+
* stdin is a TTY, key input temporarily enables raw mode for the scope of the
|
|
8
|
+
* service, so callers should acquire it with a scope or use the provided layer
|
|
9
|
+
* to ensure terminal state is restored. In non-TTY environments, terminal
|
|
10
|
+
* dimensions may be reported as zero and raw-mode key handling is unavailable.
|
|
11
|
+
*
|
|
12
|
+
* @since 4.0.0
|
|
3
13
|
*/
|
|
4
14
|
import * as NodeTerminal from "@effect/platform-node-shared/NodeTerminal";
|
|
5
15
|
/**
|
|
6
|
-
*
|
|
16
|
+
* Creates a scoped `Terminal` service backed by process stdin/stdout, using the
|
|
17
|
+
* optional predicate to decide when key input should end the input stream.
|
|
18
|
+
*
|
|
7
19
|
* @category constructors
|
|
20
|
+
* @since 4.0.0
|
|
8
21
|
*/
|
|
9
22
|
export const make = NodeTerminal.make;
|
|
10
23
|
/**
|
|
11
|
-
*
|
|
24
|
+
* Provides the default process-backed `Terminal` service, ending key input on
|
|
25
|
+
* the default quit keys.
|
|
26
|
+
*
|
|
12
27
|
* @category layers
|
|
28
|
+
* @since 4.0.0
|
|
13
29
|
*/
|
|
14
30
|
export const layer = NodeTerminal.layer;
|
|
15
31
|
//# 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;;;;;;;;;;;;;AAaA,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":"AAwBA,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,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Parent-side Node.js support for Effect workers.
|
|
3
|
+
*
|
|
4
|
+
* This module provides the `WorkerPlatform` used by Node programs that spawn
|
|
5
|
+
* and communicate with `node:worker_threads` workers or IPC-enabled child
|
|
6
|
+
* processes through Effect's worker protocol. Pair it with `NodeWorkerRunner`
|
|
7
|
+
* in the worker entrypoint when building worker-backed RPC clients, offloading
|
|
8
|
+
* CPU-bound work, isolating Node resources, or hosting services that should
|
|
9
|
+
* exchange typed messages with the parent process.
|
|
10
|
+
*
|
|
11
|
+
* Worker-thread spawners can use `postMessage` transfer lists for values such
|
|
12
|
+
* as `ArrayBuffer` and `MessagePort`, but transferring moves ownership and
|
|
13
|
+
* invalid transfer lists surface as worker send or receive failures.
|
|
14
|
+
* Child-process spawners must provide an IPC channel, for example via
|
|
15
|
+
* `child_process.fork` or `stdio: "ipc"`; their messages use Node IPC
|
|
16
|
+
* serialization and this module does not forward transfer lists to
|
|
17
|
+
* `ChildProcess.send`. Scope finalization sends the worker close signal and
|
|
18
|
+
* waits for exit before falling back to `terminate()` or `SIGKILL`.
|
|
19
|
+
*
|
|
20
|
+
* @since 4.0.0
|
|
3
21
|
*/
|
|
4
22
|
import * as Deferred from "effect/Deferred";
|
|
5
23
|
import * as Effect from "effect/Effect";
|
|
@@ -9,8 +27,12 @@ import * as Scope from "effect/Scope";
|
|
|
9
27
|
import * as Worker from "effect/unstable/workers/Worker";
|
|
10
28
|
import { WorkerError, WorkerReceiveError } from "effect/unstable/workers/WorkerError";
|
|
11
29
|
/**
|
|
12
|
-
*
|
|
30
|
+
* Provides the Node `WorkerPlatform` for `worker_threads` workers and child
|
|
31
|
+
* process workers, wiring messages, errors, and exits into Effect workers and
|
|
32
|
+
* terminating the worker if graceful shutdown times out.
|
|
33
|
+
*
|
|
13
34
|
* @category layers
|
|
35
|
+
* @since 4.0.0
|
|
14
36
|
*/
|
|
15
37
|
export const layerPlatform = /*#__PURE__*/Layer.succeed(Worker.WorkerPlatform)(/*#__PURE__*/Worker.makePlatform()({
|
|
16
38
|
setup({
|
|
@@ -74,8 +96,11 @@ export const layerPlatform = /*#__PURE__*/Layer.succeed(Worker.WorkerPlatform)(/
|
|
|
74
96
|
}
|
|
75
97
|
}));
|
|
76
98
|
/**
|
|
77
|
-
*
|
|
99
|
+
* Provides the Node `WorkerPlatform` together with a `Worker.Spawner` created
|
|
100
|
+
* from the supplied worker or child-process spawning function.
|
|
101
|
+
*
|
|
78
102
|
* @category layers
|
|
103
|
+
* @since 4.0.0
|
|
79
104
|
*/
|
|
80
105
|
export const layer = spawn => Layer.merge(Worker.layerSpawner(spawn), layerPlatform);
|
|
81
106
|
//# sourceMappingURL=NodeWorker.js.map
|
package/dist/NodeWorker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeWorker.js","names":["Deferred","Effect","Exit","Layer","Scope","Worker","WorkerError","WorkerReceiveError","layerPlatform","succeed","WorkerPlatform","makePlatform","setup","scope","worker","exitDeferred","makeUnsafe","thing","postMessage","msg","t","kill","terminate","_","send","on","doneUnsafe","void","as","addFinalizer","suspend","await","pipe","timeout","catchCause","sync","listen","deferred","emit","port","message","cause","reason","code","layer","spawn","merge","layerSpawner"],"sources":["../src/NodeWorker.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeWorker.js","names":["Deferred","Effect","Exit","Layer","Scope","Worker","WorkerError","WorkerReceiveError","layerPlatform","succeed","WorkerPlatform","makePlatform","setup","scope","worker","exitDeferred","makeUnsafe","thing","postMessage","msg","t","kill","terminate","_","send","on","doneUnsafe","void","as","addFinalizer","suspend","await","pipe","timeout","catchCause","sync","listen","deferred","emit","port","message","cause","reason","code","layer","spawn","merge","layerSpawner"],"sources":["../src/NodeWorker.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKA,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,gCAAgC;AACxD,SAASC,WAAW,EAAEC,kBAAkB,QAAQ,qCAAqC;AAIrF;;;;;;;;AAQA,OAAO,MAAMC,aAAa,gBAAuCL,KAAK,CAACM,OAAO,CAACJ,MAAM,CAACK,cAAc,CAAC,cACnGL,MAAM,CAACM,YAAY,EAAoD,CAAC;EACtEC,KAAKA,CAAC;IAAEC,KAAK;IAAEC;EAAM,CAAE;IACrB,MAAMC,YAAY,GAAGf,QAAQ,CAACgB,UAAU,EAAqB;IAC7D,MAAMC,KAAK,GAAG,aAAa,IAAIH,MAAM,GACnC;MACEI,WAAWA,CAACC,GAAQ,EAAEC,CAAO;QAC3BN,MAAM,CAACI,WAAW,CAACC,GAAG,EAAEC,CAAC,CAAC;MAC5B,CAAC;MACDC,IAAI,EAAEA,CAAA,KAAMP,MAAM,CAACQ,SAAS,EAAE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;IACFF,IAAI,CAACzB,MAAM,CAACW,EAAE,CAAC,OAAO,EAAGgB,KAAK,IAAI;MAChCzC,QAAQ,CAAC0B,UAAU,CACjBW,QAAQ,EACR,IAAI/B,WAAW,CAAC;QACdoC,MAAM,EAAE,IAAInC,kBAAkB,CAAC;UAC7BiC,OAAO,EAAE,4BAA4B;UACrCC;SACD;OACF,CAAC,CACH;IACH,CAAC,CAAC;IACFF,IAAI,CAACzB,MAAM,CAACW,EAAE,CAAC,MAAM,EAAGkB,IAAI,IAAI;MAC9B3C,QAAQ,CAAC0B,UAAU,CACjBW,QAAQ,EACR,IAAI/B,WAAW,CAAC;QACdoC,MAAM,EAAE,IAAInC,kBAAkB,CAAC;UAC7BiC,OAAO,EAAE,mCAAmC,GAAGG;SAChD;OACF,CAAC,CACH;IACH,CAAC,CAAC;IACF,OAAO1C,MAAM,CAAC0B,IAAI;EACpB;CACD,CAAC,CACH;AAED;;;;;;;AAOA,OAAO,MAAMiB,KAAK,GAChBC,KAAuE,IAEvE1C,KAAK,CAAC2C,KAAK,CACTzC,MAAM,CAAC0C,YAAY,CAACF,KAAK,CAAC,EAC1BrC,aAAa,CACd","ignoreList":[]}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as Layer from "effect/Layer";
|
|
2
2
|
import * as WorkerRunner from "effect/unstable/workers/WorkerRunner";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Provides the `WorkerRunnerPlatform` for code running inside a Node worker
|
|
5
|
+
* thread or child process, routing parent messages to the registered handler
|
|
6
|
+
* and sending responses back through the parent channel.
|
|
7
|
+
*
|
|
5
8
|
* @category layers
|
|
9
|
+
* @since 4.0.0
|
|
6
10
|
*/
|
|
7
11
|
export declare const layer: Layer.Layer<WorkerRunner.WorkerRunnerPlatform>;
|
|
8
12
|
//# sourceMappingURL=NodeWorkerRunner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeWorkerRunner.d.ts","sourceRoot":"","sources":["../src/NodeWorkerRunner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeWorkerRunner.d.ts","sourceRoot":"","sources":["../src/NodeWorkerRunner.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,YAAY,MAAM,sCAAsC,CAAA;AAGpE;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,oBAAoB,CA+E/D,CAAA"}
|
package/dist/NodeWorkerRunner.js
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Runtime support for Effect workers that are executed by Node.js.
|
|
3
|
+
*
|
|
4
|
+
* This module is intended to be installed in the program running inside a
|
|
5
|
+
* `node:worker_threads` worker or an IPC-enabled child process. It provides the
|
|
6
|
+
* `WorkerRunnerPlatform` used by `WorkerRunner` to receive request messages
|
|
7
|
+
* from the parent, run the registered Effect handler, and send responses back
|
|
8
|
+
* over the parent channel.
|
|
9
|
+
*
|
|
10
|
+
* Use it when the parent side is created with `NodeWorker` and the worker code
|
|
11
|
+
* needs to perform CPU-bound work, isolate Node resources, or host services that
|
|
12
|
+
* should communicate through the Effect worker protocol. The runner must be
|
|
13
|
+
* started from an actual worker context: `parentPort` is required for worker
|
|
14
|
+
* threads, while child processes must be spawned with an IPC channel so
|
|
15
|
+
* `process.send` is available. Transfer lists only apply to worker-thread
|
|
16
|
+
* `postMessage`; child-process messages go through Node IPC serialization.
|
|
17
|
+
* Shutdown is coordinated by the parent message protocol, so long-running
|
|
18
|
+
* handlers should remain interruptible and keep resource cleanup in scopes.
|
|
19
|
+
*
|
|
20
|
+
* @since 4.0.0
|
|
3
21
|
*/
|
|
4
22
|
import * as Cause from "effect/Cause";
|
|
5
23
|
import * as Deferred from "effect/Deferred";
|
|
@@ -11,8 +29,12 @@ import { WorkerError, WorkerReceiveError, WorkerSpawnError } from "effect/unstab
|
|
|
11
29
|
import * as WorkerRunner from "effect/unstable/workers/WorkerRunner";
|
|
12
30
|
import * as WorkerThreads from "node:worker_threads";
|
|
13
31
|
/**
|
|
14
|
-
*
|
|
32
|
+
* Provides the `WorkerRunnerPlatform` for code running inside a Node worker
|
|
33
|
+
* thread or child process, routing parent messages to the registered handler
|
|
34
|
+
* and sending responses back through the parent channel.
|
|
35
|
+
*
|
|
15
36
|
* @category layers
|
|
37
|
+
* @since 4.0.0
|
|
16
38
|
*/
|
|
17
39
|
export const layer = /*#__PURE__*/Layer.succeed(WorkerRunner.WorkerRunnerPlatform)({
|
|
18
40
|
start() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeWorkerRunner.js","names":["Cause","Deferred","Effect","Exit","Fiber","Layer","WorkerError","WorkerReceiveError","WorkerSpawnError","WorkerRunner","WorkerThreads","layer","succeed","WorkerRunnerPlatform","start","gen","parentPort","process","send","reason","message","sendUnsafe","_portId","transfers","postMessage","_transfers","sync","run","handler","scopedWith","fnUntraced","scope","closeLatch","makeUnsafe","trackFiber","runIn","services","context","runFork","runForkWith","onExit","exit","_tag","hasInterruptsOnly","cause","logError","on","result","isEffect","fiber","addObserver","close","channel","unref","doneUnsafe","void","await"],"sources":["../src/NodeWorkerRunner.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeWorkerRunner.js","names":["Cause","Deferred","Effect","Exit","Fiber","Layer","WorkerError","WorkerReceiveError","WorkerSpawnError","WorkerRunner","WorkerThreads","layer","succeed","WorkerRunnerPlatform","start","gen","parentPort","process","send","reason","message","sendUnsafe","_portId","transfers","postMessage","_transfers","sync","run","handler","scopedWith","fnUntraced","scope","closeLatch","makeUnsafe","trackFiber","runIn","services","context","runFork","runForkWith","onExit","exit","_tag","hasInterruptsOnly","cause","logError","on","result","isEffect","fiber","addObserver","close","channel","unref","doneUnsafe","void","await"],"sources":["../src/NodeWorkerRunner.ts"],"sourcesCont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D,QAAQ,CAACqD,UAAU,CAACtB,UAAU,EAAE7B,IAAI,CAACoD,IAAI,CAAC;UAC5C;QACF,CAAC,CAAC;QAEF,IAAI7C,aAAa,CAACM,UAAU,EAAE;UAC5BN,aAAa,CAACM,UAAU,CAAC8B,EAAE,CAAC,cAAc,EAAGF,KAAK,IAAI;YACpD3C,QAAQ,CAACqD,UAAU,CACjBtB,UAAU,EACV,IAAI1B,WAAW,CAAC;cACda,MAAM,EAAE,IAAIZ,kBAAkB,CAAC;gBAC7Ba,OAAO,EAAE,6BAA6B;gBACtCwB;eACD;aACF,CAAC,CACH;UACH,CAAC,CAAC;UACFlC,aAAa,CAACM,UAAU,CAAC8B,EAAE,CAAC,OAAO,EAAGF,KAAK,IAAI;YAC7C3C,QAAQ,CAACqD,UAAU,CACjBtB,UAAU,EACV,IAAI1B,WAAW,CAAC;cACda,MAAM,EAAE,IAAIZ,kBAAkB,CAAC;gBAC7Ba,OAAO,EAAE,6BAA6B;gBACtCwB;eACD;aACF,CAAC,CACH;UACH,CAAC,CAAC;QACJ;QAEAvB,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAElB,OAAO,OAAOpB,QAAQ,CAACuD,KAAK,CAACxB,UAAU,CAAC;MAC1C,CAAC,CAAC,CAAC;MAEL,OAAO;QAAEL,GAAG;QAAET,IAAI;QAAEG;MAAU,CAAE;IAClC,CAAC,CAAC;EACJ;CACD,CAAC","ignoreList":[]}
|
package/dist/Undici.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @since
|
|
2
|
+
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
import Undici from "undici";
|
|
5
5
|
/**
|
|
6
|
-
* @since 1.0.0
|
|
7
6
|
* @category undici
|
|
7
|
+
* @since 4.0.0
|
|
8
8
|
*/
|
|
9
9
|
export * from "undici";
|
|
10
10
|
/**
|
|
11
|
-
* @since 1.0.0
|
|
12
11
|
* @category undici
|
|
12
|
+
* @since 4.0.0
|
|
13
13
|
*/
|
|
14
14
|
export default Undici;
|
|
15
15
|
//# sourceMappingURL=Undici.d.ts.map
|
package/dist/Undici.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @since
|
|
2
|
+
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
import Undici from "undici";
|
|
5
5
|
/**
|
|
6
|
-
* @since 1.0.0
|
|
7
6
|
* @category undici
|
|
7
|
+
* @since 4.0.0
|
|
8
8
|
*/
|
|
9
9
|
export * from "undici";
|
|
10
10
|
/**
|
|
11
|
-
* @since 1.0.0
|
|
12
11
|
* @category undici
|
|
12
|
+
* @since 4.0.0
|
|
13
13
|
*/
|
|
14
14
|
export default Undici;
|
|
15
15
|
//# sourceMappingURL=Undici.js.map
|