@effect/platform-node 4.0.0-beta.70 → 4.0.0-beta.71
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 +6 -0
- package/dist/Mime.d.ts.map +1 -1
- package/dist/Mime.js +6 -0
- package/dist/Mime.js.map +1 -1
- package/dist/NodeCrypto.d.ts.map +1 -1
- package/dist/NodeCrypto.js +9 -1
- package/dist/NodeCrypto.js.map +1 -1
- package/dist/NodeFileSystem.d.ts.map +1 -1
- package/dist/NodeFileSystem.js +22 -14
- package/dist/NodeFileSystem.js.map +1 -1
- package/dist/NodeHttpClient.d.ts +31 -22
- package/dist/NodeHttpClient.d.ts.map +1 -1
- package/dist/NodeHttpClient.js +29 -20
- package/dist/NodeHttpClient.js.map +1 -1
- package/dist/NodeHttpIncomingMessage.d.ts +23 -10
- package/dist/NodeHttpIncomingMessage.d.ts.map +1 -1
- package/dist/NodeHttpIncomingMessage.js +23 -10
- package/dist/NodeHttpIncomingMessage.js.map +1 -1
- package/dist/NodeMultipart.d.ts +31 -16
- package/dist/NodeMultipart.d.ts.map +1 -1
- package/dist/NodeMultipart.js +29 -14
- package/dist/NodeMultipart.js.map +1 -1
- package/dist/NodePath.d.ts.map +1 -1
- package/dist/NodePath.js +24 -11
- package/dist/NodePath.js.map +1 -1
- package/dist/NodeRedis.d.ts +34 -16
- package/dist/NodeRedis.d.ts.map +1 -1
- package/dist/NodeRedis.js +33 -15
- package/dist/NodeRedis.js.map +1 -1
- package/dist/NodeRuntime.d.ts +3 -3
- package/dist/NodeRuntime.d.ts.map +1 -1
- package/dist/NodeRuntime.js +26 -12
- package/dist/NodeRuntime.js.map +1 -1
- package/dist/NodeServices.d.ts +31 -16
- package/dist/NodeServices.d.ts.map +1 -1
- package/dist/NodeServices.js.map +1 -1
- package/dist/NodeSocket.d.ts.map +1 -1
- package/dist/NodeSocket.js +31 -16
- package/dist/NodeSocket.js.map +1 -1
- package/dist/NodeStdio.d.ts.map +1 -1
- package/dist/NodeStdio.js +21 -13
- package/dist/NodeStdio.js.map +1 -1
- package/dist/NodeTerminal.d.ts.map +1 -1
- package/dist/NodeTerminal.js +18 -8
- package/dist/NodeTerminal.js.map +1 -1
- package/dist/NodeWorker.d.ts.map +1 -1
- package/dist/NodeWorker.js +28 -14
- package/dist/NodeWorker.js.map +1 -1
- package/dist/NodeWorkerRunner.d.ts.map +1 -1
- package/dist/NodeWorkerRunner.js +35 -15
- package/dist/NodeWorkerRunner.js.map +1 -1
- package/dist/Undici.d.ts +13 -0
- package/dist/Undici.d.ts.map +1 -1
- package/dist/Undici.js +13 -0
- package/dist/Undici.js.map +1 -1
- package/dist/index.d.ts +0 -350
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -350
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/Mime.ts +7 -0
- package/src/NodeCrypto.ts +9 -1
- package/src/NodeFileSystem.ts +22 -14
- package/src/NodeHttpClient.ts +29 -20
- package/src/NodeHttpIncomingMessage.ts +23 -10
- package/src/NodeMultipart.ts +29 -14
- package/src/NodePath.ts +24 -11
- package/src/NodeRedis.ts +33 -15
- package/src/NodeRuntime.ts +28 -14
- package/src/NodeServices.ts +31 -16
- package/src/NodeSocket.ts +29 -14
- package/src/NodeStdio.ts +21 -13
- package/src/NodeTerminal.ts +18 -8
- package/src/NodeWorker.ts +28 -14
- package/src/NodeWorkerRunner.ts +35 -15
- package/src/Undici.ts +13 -0
- package/src/index.ts +0 -350
package/dist/NodePath.js
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Node.js layers for Effect's `Path` service.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* not read the filesystem or validate that paths
|
|
13
|
-
*
|
|
14
|
-
*
|
|
4
|
+
* This module adapts Node's path and file URL behavior to the
|
|
5
|
+
* platform-independent `Path` service. Provide one of its layers when a Node
|
|
6
|
+
* program needs to build, normalize, parse, resolve, or convert paths without
|
|
7
|
+
* depending directly on `node:path`.
|
|
8
|
+
*
|
|
9
|
+
* **Mental model**
|
|
10
|
+
*
|
|
11
|
+
* `Path` is a syntactic service: it manipulates strings and `file:` URLs. It
|
|
12
|
+
* does not read the filesystem, check permissions, or validate that paths
|
|
13
|
+
* exist. The selected layer decides which separator, drive-letter, UNC, and URL
|
|
14
|
+
* conversion rules are used.
|
|
15
|
+
*
|
|
16
|
+
* **Common tasks**
|
|
17
|
+
*
|
|
18
|
+
* Use `layer` for host-platform Node semantics, `layerPosix` for stable POSIX
|
|
19
|
+
* behavior, and `layerWin32` for stable Windows behavior. `NodeServices.layer`
|
|
20
|
+
* already includes `layer`, so import this module directly when a program wants
|
|
21
|
+
* only path support or a platform-specific variant.
|
|
22
|
+
*
|
|
23
|
+
* **Gotchas**
|
|
24
|
+
*
|
|
25
|
+
* Results that are correct on one platform may not be portable to another.
|
|
26
|
+
* `fromFileUrl` and `toFileUrl` use Node's `node:url` conversion rules and
|
|
27
|
+
* report invalid conversions as `BadArgument` failures.
|
|
15
28
|
*
|
|
16
29
|
* @since 4.0.0
|
|
17
30
|
*/
|
package/dist/NodePath.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodePath.js","names":["NodePath","layer","layerPosix","layerWin32"],"sources":["../src/NodePath.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodePath.js","names":["NodePath","layer","layerPosix","layerWin32"],"sources":["../src/NodePath.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,OAAO,KAAKA,QAAQ,MAAM,uCAAuC;AAIjE;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAsBD,QAAQ,CAACC,KAAK;AAEtD;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAsBF,QAAQ,CAACE,UAAU;AAEhE;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAsBH,QAAQ,CAACG,UAAU","ignoreList":[]}
|
package/dist/NodeRedis.d.ts
CHANGED
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Node.js Redis integration backed by `ioredis`.
|
|
3
3
|
*
|
|
4
|
-
* This module
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
4
|
+
* This module creates a scoped `ioredis` client and exposes it in two forms:
|
|
5
|
+
* the generic `Redis` service consumed by Effect persistence modules, and the
|
|
6
|
+
* {@link NodeRedis} service for code that needs direct access to the underlying
|
|
7
|
+
* client.
|
|
8
|
+
*
|
|
9
|
+
* **Mental model**
|
|
10
|
+
*
|
|
11
|
+
* - {@link layer} creates one `ioredis` client from explicit client options
|
|
12
|
+
* - {@link layerConfig} reads the same options from `Config`
|
|
13
|
+
* - Building the layer opens the client, and closing the layer scope calls
|
|
14
|
+
* `quit`
|
|
15
|
+
* - The generic `Redis` service sends command strings through `client.call`
|
|
16
|
+
* - {@link NodeRedis} exposes the raw client plus `use`, which maps promise
|
|
17
|
+
* failures into `RedisError`
|
|
18
|
+
*
|
|
19
|
+
* **Common tasks**
|
|
20
|
+
*
|
|
21
|
+
* - Provide Redis-backed persistence, persisted queues, or distributed rate
|
|
22
|
+
* limiting in Node.js
|
|
23
|
+
* - Configure connection, TLS, database, retry, and reconnect behavior with
|
|
24
|
+
* standard `ioredis` options
|
|
25
|
+
* - Run custom Redis commands through {@link NodeRedis} when the generic
|
|
26
|
+
* `Redis` service does not cover the command shape you need
|
|
27
|
+
*
|
|
28
|
+
* **Gotchas**
|
|
29
|
+
*
|
|
30
|
+
* - Install the layer at the lifetime you want for the connection; a short
|
|
31
|
+
* scope opens and closes a Redis client for that scope
|
|
32
|
+
* - Persistence and rate limiter stores create their own keys and Lua scripts
|
|
33
|
+
* on top of this service, so choose stable prefixes and store ids
|
|
34
|
+
* - Persisted values may fail to decode after schema changes; plan migrations
|
|
35
|
+
* or cleanup for long-lived Redis data
|
|
36
|
+
* - Avoid unbounded high-cardinality rate-limit keys unless another process or
|
|
37
|
+
* key policy bounds their lifetime
|
|
20
38
|
*
|
|
21
39
|
* @since 4.0.0
|
|
22
40
|
*/
|
package/dist/NodeRedis.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRedis.d.ts","sourceRoot":"","sources":["../src/NodeRedis.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeRedis.d.ts","sourceRoot":"","sources":["../src/NodeRedis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAA;AAC1D,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;;qBAWf,OAAO,CAAC,KAAK;kBAChB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;;AAVnG;;;;;;;GAOG;AACH,qBAAa,SAAU,SAAQ,cAGQ;CAAG;AAiC1C;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAChB,UAAU,OAAO,CAAC,YAAY,GAAG,SAAS,KACzC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAuC,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,CACxB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,EAAE,MAAM,CAAC,WAAW,CAOzD,CAAA"}
|
package/dist/NodeRedis.js
CHANGED
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Node.js Redis integration backed by `ioredis`.
|
|
3
3
|
*
|
|
4
|
-
* This module
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* distributed rate limiting, or custom Redis commands alongside the Effect
|
|
9
|
-
* services that build on Redis.
|
|
4
|
+
* This module creates a scoped `ioredis` client and exposes it in two forms:
|
|
5
|
+
* the generic `Redis` service consumed by Effect persistence modules, and the
|
|
6
|
+
* {@link NodeRedis} service for code that needs direct access to the underlying
|
|
7
|
+
* client.
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
9
|
+
* **Mental model**
|
|
10
|
+
*
|
|
11
|
+
* - {@link layer} creates one `ioredis` client from explicit client options
|
|
12
|
+
* - {@link layerConfig} reads the same options from `Config`
|
|
13
|
+
* - Building the layer opens the client, and closing the layer scope calls
|
|
14
|
+
* `quit`
|
|
15
|
+
* - The generic `Redis` service sends command strings through `client.call`
|
|
16
|
+
* - {@link NodeRedis} exposes the raw client plus `use`, which maps promise
|
|
17
|
+
* failures into `RedisError`
|
|
18
|
+
*
|
|
19
|
+
* **Common tasks**
|
|
20
|
+
*
|
|
21
|
+
* - Provide Redis-backed persistence, persisted queues, or distributed rate
|
|
22
|
+
* limiting in Node.js
|
|
23
|
+
* - Configure connection, TLS, database, retry, and reconnect behavior with
|
|
24
|
+
* standard `ioredis` options
|
|
25
|
+
* - Run custom Redis commands through {@link NodeRedis} when the generic
|
|
26
|
+
* `Redis` service does not cover the command shape you need
|
|
27
|
+
*
|
|
28
|
+
* **Gotchas**
|
|
29
|
+
*
|
|
30
|
+
* - Install the layer at the lifetime you want for the connection; a short
|
|
31
|
+
* scope opens and closes a Redis client for that scope
|
|
32
|
+
* - Persistence and rate limiter stores create their own keys and Lua scripts
|
|
33
|
+
* on top of this service, so choose stable prefixes and store ids
|
|
34
|
+
* - Persisted values may fail to decode after schema changes; plan migrations
|
|
35
|
+
* or cleanup for long-lived Redis data
|
|
36
|
+
* - Avoid unbounded high-cardinality rate-limit keys unless another process or
|
|
37
|
+
* key policy bounds their lifetime
|
|
20
38
|
*
|
|
21
39
|
* @since 4.0.0
|
|
22
40
|
*/
|
package/dist/NodeRedis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRedis.js","names":["Config","Context","Effect","Fn","Layer","Scope","Redis","IoRedis","NodeRedis","Service","make","fnUntraced","options","scope","addFinalizer","promise","client","quit","use","f","tryPromise","try","catch","cause","RedisError","redis","send","command","args","call","nodeRedis","identity","pipe","add","layer","effectContext","layerConfig","unwrap","flatMap"],"sources":["../src/NodeRedis.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeRedis.js","names":["Config","Context","Effect","Fn","Layer","Scope","Redis","IoRedis","NodeRedis","Service","make","fnUntraced","options","scope","addFinalizer","promise","client","quit","use","f","tryPromise","try","catch","cause","RedisError","redis","send","command","args","call","nodeRedis","identity","pipe","add","layer","effectContext","layerConfig","unwrap","flatMap"],"sources":["../src/NodeRedis.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,OAAO,KAAKA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;MAAK,CAAE;KACjD;GACJ,CAAC;EAEF,MAAMO,SAAS,GAAG3B,EAAE,CAAC4B,QAAQ,CAAuB;IAClDf,MAAM;IACNE;GACD,CAAC;EAEF,OAAOjB,OAAO,CAACS,IAAI,CAACF,SAAS,EAAEsB,SAAS,CAAC,CAACE,IAAI,CAC5C/B,OAAO,CAACgC,GAAG,CAAC3B,KAAK,CAACA,KAAK,EAAEmB,KAAK,CAAC,CAChC;AACH,CAAC,CAAC;AAEF;;;;;;;AAOA,OAAO,MAAMS,KAAK,GAChBtB,OAA0C,IACDR,KAAK,CAAC+B,aAAa,CAACzB,IAAI,CAACE,OAAO,CAAC,CAAC;AAE7E;;;;;;;AAOA,OAAO,MAAMwB,WAAW,GAGtBxB,OAA0C,IAE1CR,KAAK,CAAC+B,aAAa,CACjBnC,MAAM,CAACqC,MAAM,CAACzB,OAAO,CAAC,CAACoB,IAAI,CACzB9B,MAAM,CAACoC,OAAO,CAAC5B,IAAI,CAAC,CACrB,CACF","ignoreList":[]}
|
package/dist/NodeRuntime.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type * as Runtime from "effect/Runtime";
|
|
|
5
5
|
*
|
|
6
6
|
* **When to use**
|
|
7
7
|
*
|
|
8
|
-
* Use
|
|
8
|
+
* Use to run an Effect as your application's main program, especially
|
|
9
9
|
* when you need structured error handling, log management, interrupt support,
|
|
10
10
|
* or advanced teardown capabilities.
|
|
11
11
|
*
|
|
@@ -30,7 +30,7 @@ export declare const runMain: {
|
|
|
30
30
|
*
|
|
31
31
|
* **When to use**
|
|
32
32
|
*
|
|
33
|
-
* Use
|
|
33
|
+
* Use to run an Effect as your application's main program, especially
|
|
34
34
|
* when you need structured error handling, log management, interrupt support,
|
|
35
35
|
* or advanced teardown capabilities.
|
|
36
36
|
*
|
|
@@ -58,7 +58,7 @@ export declare const runMain: {
|
|
|
58
58
|
*
|
|
59
59
|
* **When to use**
|
|
60
60
|
*
|
|
61
|
-
* Use
|
|
61
|
+
* Use to run an Effect as your application's main program, especially
|
|
62
62
|
* when you need structured error handling, log management, interrupt support,
|
|
63
63
|
* or advanced teardown capabilities.
|
|
64
64
|
*
|
|
@@ -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":"AAgCA,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,17 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Node.js
|
|
2
|
+
* Node.js process runner for starting an Effect program at the application
|
|
3
|
+
* edge.
|
|
3
4
|
*
|
|
4
|
-
* This module exposes `runMain`, the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* This module exposes `runMain`, the launcher used by Node CLIs, scripts,
|
|
6
|
+
* servers, and workers when a single Effect should become the process root. It
|
|
7
|
+
* handles runtime error reporting, Node process signals, and teardown so the
|
|
8
|
+
* rest of the program can stay inside Effect.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* **Mental model**
|
|
11
|
+
*
|
|
12
|
+
* `runMain` is the last call in `main.ts`: build the effect, provide the layers
|
|
13
|
+
* it needs, then hand the self-contained program to this module. The function
|
|
14
|
+
* does not provide Node services itself; use `NodeServices.layer` or narrower
|
|
15
|
+
* platform layers before launching.
|
|
16
|
+
*
|
|
17
|
+
* **Common tasks**
|
|
18
|
+
*
|
|
19
|
+
* - Run a CLI command or script and let failures become process failures.
|
|
20
|
+
* - Keep a server or worker fiber alive as the process main program.
|
|
21
|
+
* - Override teardown or disable automatic error reporting at the boundary.
|
|
22
|
+
*
|
|
23
|
+
* **Gotchas**
|
|
24
|
+
*
|
|
25
|
+
* `SIGINT` and `SIGTERM` interrupt the main fiber so scoped finalizers can run.
|
|
26
|
+
* Clean success lets the event loop drain naturally, while signal-triggered
|
|
27
|
+
* interruption or a non-zero teardown code exits the process. Keep long-lived
|
|
28
|
+
* resources in Effect scopes and avoid finalizers that never complete.
|
|
15
29
|
*
|
|
16
30
|
* @since 4.0.0
|
|
17
31
|
*/
|
|
@@ -21,7 +35,7 @@ import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
|
|
|
21
35
|
*
|
|
22
36
|
* **When to use**
|
|
23
37
|
*
|
|
24
|
-
* Use
|
|
38
|
+
* Use to run an Effect as your application's main program, especially
|
|
25
39
|
* when you need structured error handling, log management, interrupt support,
|
|
26
40
|
* or advanced teardown capabilities.
|
|
27
41
|
*
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,OAAO,KAAKA,WAAW,MAAM,0CAA0C;AAIvE;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,MAAMC,OAAO,GA8DhBD,WAAW,CAACC,OAAO","ignoreList":[]}
|
package/dist/NodeServices.d.ts
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* interaction, and
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
2
|
+
* Standard Node.js service bundle for Effect applications.
|
|
3
|
+
*
|
|
4
|
+
* `NodeServices.layer` provides the Node implementations of the core services
|
|
5
|
+
* most command-line programs and server entrypoints need: child process
|
|
6
|
+
* spawning, cryptography, filesystem access, path operations, stdio, terminal
|
|
7
|
+
* interaction, and related process I/O.
|
|
8
|
+
*
|
|
9
|
+
* **Mental model**
|
|
10
|
+
*
|
|
11
|
+
* Application code should depend on the individual Effect service tags it uses,
|
|
12
|
+
* such as `FileSystem`, `Path`, or `Stdio`. This module is the composition
|
|
13
|
+
* point for a Node runtime: provide the aggregate layer once near the program
|
|
14
|
+
* boundary, and those service requirements are satisfied by Node-backed
|
|
15
|
+
* implementations.
|
|
16
|
+
*
|
|
17
|
+
* **Common tasks**
|
|
18
|
+
*
|
|
19
|
+
* - Install the default Node platform services for a CLI, script, or process
|
|
20
|
+
* entrypoint with {@link layer}
|
|
21
|
+
* - Use narrower modules such as `NodeFileSystem`, `NodePath`, or `NodeStdio`
|
|
22
|
+
* when a test or embedded runtime should expose only one service
|
|
23
|
+
* - Keep libraries platform-independent by requiring service tags instead of
|
|
24
|
+
* importing this module directly
|
|
25
|
+
*
|
|
26
|
+
* **Gotchas**
|
|
27
|
+
*
|
|
28
|
+
* This is not every Node integration in `@effect/platform-node`. HTTP clients,
|
|
29
|
+
* HTTP servers, sockets, workers, Redis, and other specialized integrations
|
|
30
|
+
* still have their own modules and layers. Providing this layer also means
|
|
31
|
+
* effects can reach real process resources such as the filesystem, stdio,
|
|
32
|
+
* terminal handles, and child processes.
|
|
18
33
|
*
|
|
19
34
|
* @since 4.0.0
|
|
20
35
|
*/
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeServices.js","names":["Layer","NodeChildProcessSpawner","NodeCrypto","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":"AAqCA,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/NodeSocket.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeSocket.d.ts","sourceRoot":"","sources":["../src/NodeSocket.ts"],"names":[],"mappings":"
|
|
1
|
+
{"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
|
-
* TCP and Unix
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
2
|
+
* Node.js socket constructors and layers for Effect sockets.
|
|
3
|
+
*
|
|
4
|
+
* This module combines shared Node stream-backed socket support with
|
|
5
|
+
* Node-specific WebSocket constructor layers. Use it to open TCP clients, Unix
|
|
6
|
+
* domain socket clients, adapt existing Node `Duplex` streams, or provide
|
|
7
|
+
* WebSocket clients to protocols built on Effect's `Socket.Socket`.
|
|
8
|
+
*
|
|
9
|
+
* **Mental model**
|
|
10
|
+
*
|
|
11
|
+
* TCP and Unix sockets come from `node:net` and are exposed as scoped
|
|
12
|
+
* `Socket.Socket` values. Stream open, read, write, and close events are
|
|
13
|
+
* translated to `SocketError` values, and finalization closes or destroys the
|
|
14
|
+
* underlying stream. WebSocket layers provide only the constructor service used
|
|
15
|
+
* by `Socket.makeWebSocket`; `layerWebSocket` combines that constructor with a
|
|
16
|
+
* URL to provide a socket layer.
|
|
17
|
+
*
|
|
18
|
+
* **Common tasks**
|
|
19
|
+
*
|
|
20
|
+
* - Use `makeNet`, `makeNetChannel`, or `layerNet` for TCP connections.
|
|
21
|
+
* - Set `NetConnectOpts.path` for Unix domain sockets.
|
|
22
|
+
* - Use `fromDuplex` when another library already owns a Node `Duplex`.
|
|
23
|
+
* - Use `layerWebSocketConstructor` for the native WebSocket when present, with
|
|
24
|
+
* fallback to `ws`; use `layerWebSocketConstructorWS` to force `ws`.
|
|
25
|
+
*
|
|
26
|
+
* **Gotchas**
|
|
27
|
+
*
|
|
28
|
+
* Socket lifetime is scoped, so release the layer or scope to close the
|
|
29
|
+
* connection. Writes complete when Node accepts or flushes the chunk, not when
|
|
30
|
+
* a peer processes it. Remote `end` events complete the socket run, while
|
|
31
|
+
* abnormal closes, open timeouts, and stream errors surface through
|
|
32
|
+
* `SocketError`; handle them in the Effect that runs the socket.
|
|
18
33
|
*
|
|
19
34
|
* @since 4.0.0
|
|
20
35
|
*/
|
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","layerWebSocketConstructorWS","succeed","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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,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/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":"AA4BA,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,19 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Node.js
|
|
2
|
+
* Node.js `Stdio` layer for the current process.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* command-line arguments
|
|
6
|
-
* `process.stdin`, and
|
|
7
|
-
* `process.stderr`. It is
|
|
8
|
-
*
|
|
9
|
-
* Effect services.
|
|
4
|
+
* The exported layer satisfies the platform-independent `Stdio` service by
|
|
5
|
+
* reading command-line arguments from `process.argv`, consuming input from
|
|
6
|
+
* `process.stdin`, and writing output streams to `process.stdout` and
|
|
7
|
+
* `process.stderr`. It is the stdio bridge used by CLIs, scripts, command
|
|
8
|
+
* runners, and tests that intentionally communicate through the host process.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* **Mental model**
|
|
11
|
+
*
|
|
12
|
+
* Effects should depend on `Stdio`; this module decides that the backing
|
|
13
|
+
* streams are the global Node process handles. Provide `NodeStdio.layer` when a
|
|
14
|
+
* program only needs standard input and output, or `NodeServices.layer` when the
|
|
15
|
+
* same entrypoint also needs the other default Node services.
|
|
16
|
+
*
|
|
17
|
+
* **Gotchas**
|
|
18
|
+
*
|
|
19
|
+
* The process stdio streams are shared resources. The layer leaves stdin open
|
|
20
|
+
* and does not end stdout or stderr by default, avoiding accidental closure of
|
|
21
|
+
* handles that other code in the same process may still use. Stdio might be a
|
|
22
|
+
* pipe, file, or TTY; terminal-specific behavior such as raw mode, echo, color
|
|
23
|
+
* detection, and cursor movement belongs with terminal APIs rather than this
|
|
24
|
+
* service.
|
|
17
25
|
*
|
|
18
26
|
* @since 4.0.0
|
|
19
27
|
*/
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,OAAO,KAAKA,SAAS,MAAM,wCAAwC;AAInE;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAuBD,SAAS,CAACC,KAAK","ignoreList":[]}
|
|
@@ -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":"AAwBA,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,13 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
2
|
+
* Node.js implementation of the Effect `Terminal` service.
|
|
3
|
+
*
|
|
4
|
+
* `NodeTerminal` connects `Terminal` to the current process' stdin and stdout
|
|
5
|
+
* so Node programs can read lines, stream key presses, write display output,
|
|
6
|
+
* and inspect terminal dimensions through the Effect service environment.
|
|
7
|
+
*
|
|
8
|
+
* **Mental model**
|
|
9
|
+
*
|
|
10
|
+
* `make` acquires a scoped terminal backed by process streams, and `layer`
|
|
11
|
+
* provides that service with the default key sequence for quitting input. When
|
|
12
|
+
* stdin is a TTY, low-level key input temporarily enables raw mode for the
|
|
13
|
+
* lifetime of the scope; finalization restores the previous terminal state.
|
|
14
|
+
*
|
|
15
|
+
* **Gotchas**
|
|
16
|
+
*
|
|
17
|
+
* In non-TTY environments such as CI, pipes, or redirected input, terminal
|
|
10
18
|
* dimensions may be reported as zero and raw-mode key handling is unavailable.
|
|
19
|
+
* For plain stdin/stdout byte streams, use the standard I/O service instead of
|
|
20
|
+
* the interactive terminal service.
|
|
11
21
|
*
|
|
12
22
|
* @since 4.0.0
|
|
13
23
|
*/
|
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;;;;;;;;;;;;;;;;;;;;;;;AAuBA,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.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":"AAsCA,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,21 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Parent-side Node.js support for Effect workers.
|
|
3
3
|
*
|
|
4
|
-
* This module
|
|
5
|
-
*
|
|
6
|
-
* processes through Effect's worker protocol
|
|
7
|
-
*
|
|
8
|
-
* CPU-bound work, isolating Node resources, or hosting services that should
|
|
9
|
-
* exchange typed messages with the parent process.
|
|
4
|
+
* This module installs the `WorkerPlatform` used by a Node program that owns
|
|
5
|
+
* workers. It supports both `node:worker_threads` workers and IPC-enabled child
|
|
6
|
+
* processes, routing messages through Effect's worker protocol so higher-level
|
|
7
|
+
* worker clients can treat either runtime as the same parent-side transport.
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `
|
|
18
|
-
*
|
|
9
|
+
* **Mental model**
|
|
10
|
+
*
|
|
11
|
+
* `NodeWorker` runs in the parent process. The worker entrypoint should install
|
|
12
|
+
* `NodeWorkerRunner`, which receives parent messages, runs the registered
|
|
13
|
+
* Effect handler, and sends replies back over the same channel. Use `layer`
|
|
14
|
+
* when you want this module to provide both the platform and a `Worker.Spawner`;
|
|
15
|
+
* use `layerPlatform` when the spawner is provided elsewhere.
|
|
16
|
+
*
|
|
17
|
+
* **Common tasks**
|
|
18
|
+
*
|
|
19
|
+
* - Spawn CPU-bound or resource-isolated work in `worker_threads`.
|
|
20
|
+
* - Spawn a child process that was created with an IPC channel.
|
|
21
|
+
* - Share one parent-side worker implementation across both Node transports.
|
|
22
|
+
*
|
|
23
|
+
* **Gotchas**
|
|
24
|
+
*
|
|
25
|
+
* Worker-thread spawners can use `postMessage` transfer lists for values such as
|
|
26
|
+
* `ArrayBuffer` and `MessagePort`; transferring moves ownership, and invalid
|
|
27
|
+
* transfer lists surface as send or receive failures. Child-process spawners
|
|
28
|
+
* must provide an IPC channel, for example via `child_process.fork` or
|
|
29
|
+
* `stdio: "ipc"`; their messages use Node IPC serialization and transfer lists
|
|
30
|
+
* are not forwarded to `ChildProcess.send`. Scope finalization sends the worker
|
|
31
|
+
* close signal and waits for exit before falling back to `terminate()` or
|
|
32
|
+
* `SIGKILL`.
|
|
19
33
|
*
|
|
20
34
|
* @since 4.0.0
|
|
21
35
|
*/
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,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,QA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|
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":"AA8CA,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"}
|