@smthrs/platform-node 1.0.0-rc.5 → 1.0.0-rc.6
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/README.md +2 -2
- package/bin/win32-x64/smithers-jj-export.exe +0 -0
- package/dist/cjs/EgressHttpClient.d.ts +1 -1
- package/dist/cjs/EgressHttpClient.d.ts.map +1 -1
- package/dist/cjs/EgressHttpClient.js +4 -4
- package/dist/cjs/EgressHttpClient.js.map +2 -2
- package/dist/cjs/NodeHost.d.ts +2 -2
- package/dist/cjs/NodeHost.d.ts.map +1 -1
- package/dist/cjs/NodeHost.js.map +2 -2
- package/dist/cjs/ProcessConfinement.js +1 -1
- package/dist/cjs/ProcessConfinement.js.map +2 -2
- package/dist/cjs/ProcessReaper.d.ts +1 -1
- package/dist/cjs/ProcessReaper.d.ts.map +1 -1
- package/dist/cjs/ProcessReaper.js +1 -1
- package/dist/cjs/ProcessReaper.js.map +1 -1
- package/dist/cjs/ScopedProcess.d.ts +2 -2
- package/dist/cjs/ScopedProcess.d.ts.map +1 -1
- package/dist/cjs/ScopedProcess.js +1 -1
- package/dist/cjs/ScopedProcess.js.map +2 -2
- package/dist/cjs/internal/PipedProcess.d.ts +2 -2
- package/dist/cjs/internal/PipedProcess.d.ts.map +1 -1
- package/dist/cjs/internal/PipedProcess.js +2 -2
- package/dist/cjs/internal/PipedProcess.js.map +2 -2
- package/dist/cjs/internal/ProcessCleanup.d.ts +1 -1
- package/dist/cjs/internal/ProcessCleanup.d.ts.map +1 -1
- package/dist/cjs/internal/ProcessCleanup.js.map +1 -1
- package/dist/cjs/internal/ProcessSupervisor.d.ts +2 -2
- package/dist/cjs/internal/ProcessSupervisor.d.ts.map +1 -1
- package/dist/cjs/internal/ProcessSupervisor.js +2 -2
- package/dist/cjs/internal/ProcessSupervisor.js.map +2 -2
- package/dist/esm/EgressHttpClient.d.ts +1 -1
- package/dist/esm/EgressHttpClient.d.ts.map +1 -1
- package/dist/esm/EgressHttpClient.js +4 -4
- package/dist/esm/EgressHttpClient.js.map +1 -1
- package/dist/esm/NodeHost.d.ts +2 -2
- package/dist/esm/NodeHost.d.ts.map +1 -1
- package/dist/esm/NodeHost.js.map +1 -1
- package/dist/esm/ProcessConfinement.js +1 -1
- package/dist/esm/ProcessConfinement.js.map +1 -1
- package/dist/esm/ProcessReaper.d.ts +1 -1
- package/dist/esm/ProcessReaper.d.ts.map +1 -1
- package/dist/esm/ProcessReaper.js +1 -1
- package/dist/esm/ProcessReaper.js.map +1 -1
- package/dist/esm/ScopedProcess.d.ts +2 -2
- package/dist/esm/ScopedProcess.d.ts.map +1 -1
- package/dist/esm/ScopedProcess.js +1 -1
- package/dist/esm/ScopedProcess.js.map +1 -1
- package/dist/esm/internal/PipedProcess.d.ts +2 -2
- package/dist/esm/internal/PipedProcess.d.ts.map +1 -1
- package/dist/esm/internal/PipedProcess.js +2 -2
- package/dist/esm/internal/PipedProcess.js.map +1 -1
- package/dist/esm/internal/ProcessCleanup.d.ts +1 -1
- package/dist/esm/internal/ProcessCleanup.d.ts.map +1 -1
- package/dist/esm/internal/ProcessCleanup.js.map +1 -1
- package/dist/esm/internal/ProcessSupervisor.d.ts +2 -2
- package/dist/esm/internal/ProcessSupervisor.d.ts.map +1 -1
- package/dist/esm/internal/ProcessSupervisor.js +2 -2
- package/dist/esm/internal/ProcessSupervisor.js.map +1 -1
- package/dist/vendor/adapters.json +622 -382
- package/dist/vendor/{chunk-42QKY6T6.js → chunk-2ZAGBWTH.js} +1 -1
- package/dist/vendor/{chunk-3GR5VZ2M.js → chunk-3SL3HKQA.js} +3 -3
- package/dist/vendor/{chunk-VANKHF46.js → chunk-423HXGL6.js} +55 -23
- package/dist/vendor/{chunk-6ME2W7TF.js → chunk-4WIQ2XN7.js} +2 -2
- package/dist/vendor/{chunk-Y35ZAO5U.js → chunk-6FSJ2PMW.js} +8 -8
- package/dist/vendor/{chunk-5ZMHBXIK.js → chunk-6L2NJEOV.js} +11 -4
- package/dist/vendor/{chunk-TFIKFFSC.js → chunk-7NMJM44J.js} +2 -2
- package/dist/vendor/{chunk-OXNGN5H7.js → chunk-A7UXCEJA.js} +1 -1
- package/dist/vendor/chunk-ADP5LRUF.js +274 -0
- package/dist/vendor/{chunk-DS7GF46S.js → chunk-AWNTTSHL.js} +2 -2
- package/dist/vendor/{chunk-IIJ52ZU6.js → chunk-BUKVIAEM.js} +2 -2
- package/dist/vendor/{chunk-BKTBUBQY.js → chunk-BY3SDXID.js} +71 -7
- package/dist/vendor/{chunk-JJ24ARBQ.js → chunk-C3PGUWW5.js} +53 -33
- package/dist/vendor/{chunk-J7A4CZDO.js → chunk-D2ZL4PLZ.js} +8 -7
- package/dist/vendor/{chunk-XDKNKFBW.js → chunk-D4HEMNGU.js} +2 -2
- package/dist/vendor/{chunk-DVOAHXPG.js → chunk-FFD6R5JZ.js} +3 -3
- package/dist/vendor/{chunk-UFH5UUZK.js → chunk-HDV6VIRM.js} +1 -1
- package/dist/vendor/chunk-IWSDM4CG.js +16 -0
- package/dist/vendor/{chunk-KUUXSID7.js → chunk-KABHKTVG.js} +2 -2
- package/dist/vendor/{chunk-B3FZ67QU.js → chunk-KFDBU6RR.js} +4 -3
- package/dist/vendor/chunk-LNWGIDIG.js +20 -0
- package/dist/vendor/{chunk-TXKLEBBL.js → chunk-MUEED3C3.js} +3 -2
- package/dist/vendor/{chunk-EZWY45HP.js → chunk-N6TK35N5.js} +2 -2
- package/dist/vendor/{chunk-QPLDT6A6.js → chunk-NQO6V4KI.js} +29 -13
- package/dist/vendor/{chunk-AMQKOQNT.js → chunk-NTEWGPPG.js} +9 -9
- package/dist/vendor/chunk-NUJQMLJP.js +325 -0
- package/dist/vendor/{chunk-54RLBMTZ.js → chunk-OF3N2FN4.js} +1 -1
- package/dist/vendor/{chunk-RO2R4MJH.js → chunk-PA32ARKD.js} +17 -17
- package/dist/vendor/{chunk-JG5TTWPT.js → chunk-PECOFLCU.js} +3 -3
- package/dist/vendor/{chunk-VZBDV3TV.js → chunk-PU7QVYND.js} +2 -2
- package/dist/vendor/{chunk-2Y7WC4KU.js → chunk-QHR2RC5M.js} +2 -2
- package/dist/vendor/{chunk-QYBKAIA6.js → chunk-R327POEZ.js} +2 -2
- package/dist/vendor/chunk-RKVXYKHJ.js +29 -0
- package/dist/vendor/{chunk-XH4U3JSV.js → chunk-RQH5DSBA.js} +2 -2
- package/dist/vendor/{chunk-DWSHTSVX.js → chunk-S6QUQLBV.js} +5 -5
- package/dist/vendor/{chunk-KOZMM5PZ.js → chunk-UPIQ52FQ.js} +12 -12
- package/dist/vendor/{chunk-EGBNVEEW.js → chunk-UUQXJRMK.js} +1 -1
- package/dist/vendor/{chunk-LEUPYT3Q.js → chunk-UUYTTEDH.js} +1 -1
- package/dist/vendor/{chunk-NBVRTDTV.js → chunk-V2EB7FHY.js} +2 -2
- package/dist/vendor/{chunk-M32LDTW7.js → chunk-VIWU4EBF.js} +2 -2
- package/dist/vendor/{chunk-SIR62W3Y.js → chunk-VWSWEUN5.js} +51 -31
- package/dist/vendor/{chunk-MBSKBQ5D.js → chunk-WPZDL2D7.js} +1 -1
- package/dist/vendor/chunk-YDY5P7GL.js +20 -0
- package/dist/vendor/{chunk-FNZOJHSV.js → chunk-YFD4QFIL.js} +17 -17
- package/dist/vendor/{chunk-GXCHI7BM.js → chunk-ZVJCBTJG.js} +5 -5
- package/dist/vendor/cjs/node/NodeAddressResolver.d.ts +16 -0
- package/dist/vendor/cjs/node/NodeAddressResolver.js +1 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +13 -22
- package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +14 -8
- package/dist/vendor/cjs/node/NodeCrypto.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeDatagramSocket.d.ts +10 -0
- package/dist/vendor/cjs/node/NodeDatagramSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeDns.d.ts +51 -0
- package/dist/vendor/cjs/node/NodeDns.js +1 -0
- package/dist/vendor/cjs/node/NodeFileSystem.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeHttpClient.d.ts +21 -2
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +5 -3
- package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +8 -6
- package/dist/vendor/cjs/node/NodeHttpServer.d.ts +21 -10
- package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +4 -1
- package/dist/vendor/cjs/node/NodeMultipart.d.ts +5 -1
- package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +9 -1
- package/dist/vendor/cjs/node/NodePath.d.ts +3 -0
- package/dist/vendor/cjs/node/NodeRedis.d.ts +5 -1
- package/dist/vendor/cjs/node/NodeRuntime.d.ts +3 -0
- package/dist/vendor/cjs/node/NodeServices.d.ts +4 -1
- package/dist/vendor/cjs/node/NodeSink.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeSocket.d.ts +10 -3
- package/dist/vendor/cjs/node/NodeSocketServer.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeStdio.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeStream.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeTerminal.d.ts +6 -3
- package/dist/vendor/cjs/node/NodeWorker.d.ts +3 -1
- package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +2 -1
- package/dist/vendor/cjs/node/Undici.d.ts +3 -0
- package/dist/vendor/cjs/node/index.d.ts +40 -0
- package/dist/vendor/cjs/node-shared/NodeAddressResolver.d.ts +13 -0
- package/dist/vendor/cjs/node-shared/NodeAddressResolver.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +12 -3
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +17 -4
- package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +3 -0
- package/dist/vendor/cjs/node-shared/NodeDatagramSocket.d.ts +246 -0
- package/dist/vendor/cjs/node-shared/NodeDatagramSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeDns.d.ts +221 -0
- package/dist/vendor/cjs/node-shared/NodeDns.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +1 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +5 -1
- package/dist/vendor/cjs/node-shared/NodePath.d.ts +3 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +4 -0
- package/dist/vendor/cjs/node-shared/NodeSink.d.ts +4 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +11 -1
- package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +8 -1
- package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +1 -0
- package/dist/vendor/cjs/node-shared/NodeStream.d.ts +15 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +6 -4
- package/dist/vendor/cjs/node-shared/index.d.ts +29 -0
- package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.d.ts +1 -1
- package/dist/vendor/cjs/platform-node-shared.d.ts +29 -0
- package/dist/vendor/cjs/platform-node.d.ts +40 -0
- package/dist/vendor/node/NodeAddressResolver.d.ts +16 -0
- package/dist/vendor/node/NodeAddressResolver.js +8 -0
- package/dist/vendor/node/NodeChildProcessSpawner.d.ts +1 -0
- package/dist/vendor/node/NodeChildProcessSpawner.js +6 -6
- package/dist/vendor/node/NodeClusterHttp.d.ts +13 -22
- package/dist/vendor/node/NodeClusterHttp.js +32 -32
- package/dist/vendor/node/NodeClusterSocket.d.ts +14 -8
- package/dist/vendor/node/NodeClusterSocket.js +15 -15
- package/dist/vendor/node/NodeCrypto.d.ts +1 -0
- package/dist/vendor/node/NodeCrypto.js +2 -2
- package/dist/vendor/node/NodeDatagramSocket.d.ts +10 -0
- package/dist/vendor/node/NodeDatagramSocket.js +12 -0
- package/dist/vendor/node/NodeDns.d.ts +51 -0
- package/dist/vendor/node/NodeDns.js +12 -0
- package/dist/vendor/node/NodeFileSystem.d.ts +1 -0
- package/dist/vendor/node/NodeFileSystem.js +3 -3
- package/dist/vendor/node/NodeHttpClient.d.ts +21 -2
- package/dist/vendor/node/NodeHttpClient.js +6 -6
- package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +5 -3
- package/dist/vendor/node/NodeHttpIncomingMessage.js +4 -4
- package/dist/vendor/node/NodeHttpPlatform.d.ts +8 -6
- package/dist/vendor/node/NodeHttpPlatform.js +8 -8
- package/dist/vendor/node/NodeHttpServer.d.ts +21 -10
- package/dist/vendor/node/NodeHttpServer.js +26 -26
- package/dist/vendor/node/NodeHttpServerRequest.d.ts +4 -1
- package/dist/vendor/node/NodeHttpServerRequest.js +1 -1
- package/dist/vendor/node/NodeMultipart.d.ts +5 -1
- package/dist/vendor/node/NodeMultipart.js +5 -5
- package/dist/vendor/node/NodeMultipartParser.d.ts +9 -1
- package/dist/vendor/node/NodeMultipartParser.js +1 -1
- package/dist/vendor/node/NodePath.d.ts +3 -0
- package/dist/vendor/node/NodePath.js +2 -2
- package/dist/vendor/node/NodeRedis.d.ts +5 -1
- package/dist/vendor/node/NodeRedis.js +1 -1
- package/dist/vendor/node/NodeRuntime.d.ts +3 -0
- package/dist/vendor/node/NodeRuntime.js +2 -2
- package/dist/vendor/node/NodeServices.d.ts +4 -1
- package/dist/vendor/node/NodeServices.js +17 -17
- package/dist/vendor/node/NodeSink.d.ts +1 -0
- package/dist/vendor/node/NodeSink.js +2 -2
- package/dist/vendor/node/NodeSocket.d.ts +10 -3
- package/dist/vendor/node/NodeSocket.js +2 -2
- package/dist/vendor/node/NodeSocketServer.d.ts +1 -0
- package/dist/vendor/node/NodeSocketServer.js +3 -3
- package/dist/vendor/node/NodeStdio.d.ts +1 -0
- package/dist/vendor/node/NodeStdio.js +4 -4
- package/dist/vendor/node/NodeStream.d.ts +1 -0
- package/dist/vendor/node/NodeStream.js +3 -3
- package/dist/vendor/node/NodeTerminal.d.ts +6 -3
- package/dist/vendor/node/NodeTerminal.js +2 -2
- package/dist/vendor/node/NodeWorker.d.ts +3 -1
- package/dist/vendor/node/NodeWorker.js +1 -1
- package/dist/vendor/node/NodeWorkerRunner.d.ts +2 -1
- package/dist/vendor/node/NodeWorkerRunner.js +1 -1
- package/dist/vendor/node/Undici.d.ts +3 -0
- package/dist/vendor/node/Undici.js +1 -1
- package/dist/vendor/node/index.d.ts +40 -0
- package/dist/vendor/node/index.js +70 -55
- package/dist/vendor/node-shared/NodeAddressResolver.d.ts +13 -0
- package/dist/vendor/node-shared/NodeAddressResolver.js +7 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +12 -3
- package/dist/vendor/node-shared/NodeChildProcessSpawner.js +5 -5
- package/dist/vendor/node-shared/NodeClusterSocket.d.ts +17 -4
- package/dist/vendor/node-shared/NodeClusterSocket.js +3 -3
- package/dist/vendor/node-shared/NodeCrypto.d.ts +3 -0
- package/dist/vendor/node-shared/NodeCrypto.js +1 -1
- package/dist/vendor/node-shared/NodeDatagramSocket.d.ts +246 -0
- package/dist/vendor/node-shared/NodeDatagramSocket.js +11 -0
- package/dist/vendor/node-shared/NodeDns.d.ts +221 -0
- package/dist/vendor/node-shared/NodeDns.js +31 -0
- package/dist/vendor/node-shared/NodeFileSystem.d.ts +1 -0
- package/dist/vendor/node-shared/NodeFileSystem.js +2 -2
- package/dist/vendor/node-shared/NodeHttpCompression.d.ts +5 -1
- package/dist/vendor/node-shared/NodeHttpCompression.js +1 -1
- package/dist/vendor/node-shared/NodePath.d.ts +3 -0
- package/dist/vendor/node-shared/NodePath.js +1 -1
- package/dist/vendor/node-shared/NodeRuntime.d.ts +4 -0
- package/dist/vendor/node-shared/NodeRuntime.js +1 -1
- package/dist/vendor/node-shared/NodeSink.d.ts +4 -0
- package/dist/vendor/node-shared/NodeSink.js +1 -1
- package/dist/vendor/node-shared/NodeSocket.d.ts +11 -1
- package/dist/vendor/node-shared/NodeSocket.js +1 -1
- package/dist/vendor/node-shared/NodeSocketServer.d.ts +8 -1
- package/dist/vendor/node-shared/NodeSocketServer.js +2 -2
- package/dist/vendor/node-shared/NodeStdio.d.ts +1 -0
- package/dist/vendor/node-shared/NodeStdio.js +3 -3
- package/dist/vendor/node-shared/NodeStream.d.ts +15 -0
- package/dist/vendor/node-shared/NodeStream.js +2 -2
- package/dist/vendor/node-shared/NodeTerminal.d.ts +6 -4
- package/dist/vendor/node-shared/NodeTerminal.js +1 -1
- package/dist/vendor/node-shared/index.d.ts +29 -0
- package/dist/vendor/node-shared/index.js +34 -22
- package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.d.ts +1 -1
- package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +1 -1
- package/dist/vendor/node-shared/internal/utils.js +1 -1
- package/dist/vendor/platform-node-shared.d.ts +29 -0
- package/dist/vendor/platform-node-shared.js +34 -22
- package/dist/vendor/platform-node.d.ts +40 -0
- package/dist/vendor/platform-node.js +70 -55
- package/docs/README.md +2 -2
- package/docs/api.md +2 -2
- package/docs/concepts/host-bundle.md +2 -2
- package/docs/installation.md +8 -9
- package/docs/quickstart.md +2 -2
- package/package.json +12 -12
- package/src/EgressHttpClient.ts +4 -4
- package/src/NodeHost.ts +2 -2
- package/src/ProcessConfinement.ts +1 -1
- package/src/ProcessReaper.ts +2 -2
- package/src/ScopedProcess.ts +2 -2
- package/src/internal/PipedProcess.ts +2 -2
- package/src/internal/ProcessCleanup.ts +1 -1
- package/src/internal/ProcessSupervisor.ts +2 -2
- /package/dist/vendor/{chunk-M7CLUILA.js → chunk-3WUGYBFU.js} +0 -0
- /package/dist/vendor/{chunk-ZJMRMY57.js → chunk-ASGOJ3XA.js} +0 -0
|
@@ -3,17 +3,20 @@ 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
|
-
* Creates a scoped `Terminal` service backed by process stdin/stdout
|
|
7
|
-
*
|
|
6
|
+
* Creates a scoped `Terminal` service backed by process stdin/stdout.
|
|
7
|
+
* By default, Esc, Ctrl+C, and Ctrl+D end key input. Supply `shouldQuit` to
|
|
8
|
+
* override these quit keys.
|
|
8
9
|
*
|
|
10
|
+
* @stability unstable
|
|
9
11
|
* @category constructors
|
|
10
12
|
* @since 4.0.0
|
|
11
13
|
*/
|
|
12
14
|
export declare const make: (shouldQuit?: (input: UserInput) => boolean) => Effect<Terminal, never, Scope>;
|
|
13
15
|
/**
|
|
14
16
|
* Provides the default process-backed `Terminal` service, ending key input on
|
|
15
|
-
*
|
|
17
|
+
* bare Esc, Ctrl+C, or Ctrl+D.
|
|
16
18
|
*
|
|
19
|
+
* @stability unstable
|
|
17
20
|
* @category layers
|
|
18
21
|
* @since 4.0.0
|
|
19
22
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Layer from "effect/Layer";
|
|
2
|
-
import * as Worker from "effect/
|
|
2
|
+
import * as Worker from "effect/workers/Worker";
|
|
3
3
|
import type * as ChildProcess from "node:child_process";
|
|
4
4
|
import type * as WorkerThreads from "node:worker_threads";
|
|
5
5
|
/**
|
|
@@ -7,6 +7,7 @@ import type * as WorkerThreads from "node:worker_threads";
|
|
|
7
7
|
* process workers, wiring messages, errors, and exits into Effect workers and
|
|
8
8
|
* terminating the worker if graceful shutdown times out.
|
|
9
9
|
*
|
|
10
|
+
* @stability unstable
|
|
10
11
|
* @category layers
|
|
11
12
|
* @since 4.0.0
|
|
12
13
|
*/
|
|
@@ -15,6 +16,7 @@ export declare const layerPlatform: Layer.Layer<Worker.WorkerPlatform>;
|
|
|
15
16
|
* Provides the Node `WorkerPlatform` together with a `Worker.Spawner` created
|
|
16
17
|
* from the supplied worker or child-process spawning function.
|
|
17
18
|
*
|
|
19
|
+
* @stability unstable
|
|
18
20
|
* @category layers
|
|
19
21
|
* @since 4.0.0
|
|
20
22
|
*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as Layer from "effect/Layer";
|
|
2
|
-
import * as WorkerRunner from "effect/
|
|
2
|
+
import * as WorkerRunner from "effect/workers/WorkerRunner";
|
|
3
3
|
/**
|
|
4
4
|
* Provides the `WorkerRunnerPlatform` for code running inside a Node worker
|
|
5
5
|
* thread or child process, routing parent messages to the registered handler
|
|
6
6
|
* and sending responses back through the parent channel.
|
|
7
7
|
*
|
|
8
|
+
* @stability unstable
|
|
8
9
|
* @category layers
|
|
9
10
|
* @since 4.0.0
|
|
10
11
|
*/
|
|
@@ -12,15 +12,18 @@
|
|
|
12
12
|
* dispatcher lifetimes, mocking, aborts, and request options follow Undici's
|
|
13
13
|
* own semantics.
|
|
14
14
|
*
|
|
15
|
+
* @stability unstable
|
|
15
16
|
* @since 4.0.0
|
|
16
17
|
*/
|
|
17
18
|
import Undici from "undici";
|
|
18
19
|
/**
|
|
20
|
+
* @stability unstable
|
|
19
21
|
* @category re-exports
|
|
20
22
|
* @since 4.0.0
|
|
21
23
|
*/
|
|
22
24
|
export * from "undici";
|
|
23
25
|
/**
|
|
26
|
+
* @stability unstable
|
|
24
27
|
* @category re-exports
|
|
25
28
|
* @since 4.0.0
|
|
26
29
|
*/
|
|
@@ -1,99 +1,139 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @stability unstable
|
|
2
3
|
* @since 4.0.0
|
|
3
4
|
*/
|
|
4
5
|
/**
|
|
6
|
+
* @stability experimental
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*/
|
|
9
|
+
export * as NodeAddressResolver from "./NodeAddressResolver.ts";
|
|
10
|
+
/**
|
|
11
|
+
* @stability unstable
|
|
5
12
|
* @since 4.0.0
|
|
6
13
|
*/
|
|
7
14
|
export * as NodeChildProcessSpawner from "./NodeChildProcessSpawner.ts";
|
|
8
15
|
/**
|
|
16
|
+
* @stability unstable
|
|
9
17
|
* @since 4.0.0
|
|
10
18
|
*/
|
|
11
19
|
export * as NodeClusterHttp from "./NodeClusterHttp.ts";
|
|
12
20
|
/**
|
|
21
|
+
* @stability unstable
|
|
13
22
|
* @since 4.0.0
|
|
14
23
|
*/
|
|
15
24
|
export * as NodeClusterSocket from "./NodeClusterSocket.ts";
|
|
16
25
|
/**
|
|
26
|
+
* @stability unstable
|
|
17
27
|
* @since 1.0.0
|
|
18
28
|
*/
|
|
19
29
|
export * as NodeCrypto from "./NodeCrypto.ts";
|
|
20
30
|
/**
|
|
31
|
+
* @stability experimental
|
|
32
|
+
* @since 4.0.0
|
|
33
|
+
*/
|
|
34
|
+
export * as NodeDatagramSocket from "./NodeDatagramSocket.ts";
|
|
35
|
+
/**
|
|
36
|
+
* @stability experimental
|
|
37
|
+
* @since 4.0.0
|
|
38
|
+
*/
|
|
39
|
+
export * as NodeDns from "./NodeDns.ts";
|
|
40
|
+
/**
|
|
41
|
+
* @stability unstable
|
|
21
42
|
* @since 4.0.0
|
|
22
43
|
*/
|
|
23
44
|
export * as NodeFileSystem from "./NodeFileSystem.ts";
|
|
24
45
|
/**
|
|
46
|
+
* @stability unstable
|
|
25
47
|
* @since 4.0.0
|
|
26
48
|
*/
|
|
27
49
|
export * as NodeHttpClient from "./NodeHttpClient.ts";
|
|
28
50
|
/**
|
|
51
|
+
* @stability unstable
|
|
29
52
|
* @since 4.0.0
|
|
30
53
|
*/
|
|
31
54
|
export * as NodeHttpIncomingMessage from "./NodeHttpIncomingMessage.ts";
|
|
32
55
|
/**
|
|
56
|
+
* @stability unstable
|
|
33
57
|
* @since 4.0.0
|
|
34
58
|
*/
|
|
35
59
|
export * as NodeHttpPlatform from "./NodeHttpPlatform.ts";
|
|
36
60
|
/**
|
|
61
|
+
* @stability unstable
|
|
37
62
|
* @since 4.0.0
|
|
38
63
|
*/
|
|
39
64
|
export * as NodeHttpServer from "./NodeHttpServer.ts";
|
|
40
65
|
/**
|
|
66
|
+
* @stability unstable
|
|
41
67
|
* @since 4.0.0
|
|
42
68
|
*/
|
|
43
69
|
export * as NodeHttpServerRequest from "./NodeHttpServerRequest.ts";
|
|
44
70
|
/**
|
|
71
|
+
* @stability unstable
|
|
45
72
|
* @since 4.0.0
|
|
46
73
|
*/
|
|
47
74
|
export * as NodeMultipart from "./NodeMultipart.ts";
|
|
48
75
|
/**
|
|
76
|
+
* @stability unstable
|
|
49
77
|
* @since 4.0.0
|
|
50
78
|
*/
|
|
51
79
|
export * as NodeMultipartParser from "./NodeMultipartParser.ts";
|
|
52
80
|
/**
|
|
81
|
+
* @stability unstable
|
|
53
82
|
* @since 4.0.0
|
|
54
83
|
*/
|
|
55
84
|
export * as NodePath from "./NodePath.ts";
|
|
56
85
|
/**
|
|
86
|
+
* @stability unstable
|
|
57
87
|
* @since 4.0.0
|
|
58
88
|
*/
|
|
59
89
|
export * as NodeRedis from "./NodeRedis.ts";
|
|
60
90
|
/**
|
|
91
|
+
* @stability unstable
|
|
61
92
|
* @since 4.0.0
|
|
62
93
|
*/
|
|
63
94
|
export * as NodeRuntime from "./NodeRuntime.ts";
|
|
64
95
|
/**
|
|
96
|
+
* @stability unstable
|
|
65
97
|
* @since 4.0.0
|
|
66
98
|
*/
|
|
67
99
|
export * as NodeServices from "./NodeServices.ts";
|
|
68
100
|
/**
|
|
101
|
+
* @stability unstable
|
|
69
102
|
* @since 4.0.0
|
|
70
103
|
*/
|
|
71
104
|
export * as NodeSink from "./NodeSink.ts";
|
|
72
105
|
/**
|
|
106
|
+
* @stability unstable
|
|
73
107
|
* @since 4.0.0
|
|
74
108
|
*/
|
|
75
109
|
export * as NodeSocket from "./NodeSocket.ts";
|
|
76
110
|
/**
|
|
111
|
+
* @stability unstable
|
|
77
112
|
* @since 4.0.0
|
|
78
113
|
*/
|
|
79
114
|
export * as NodeSocketServer from "./NodeSocketServer.ts";
|
|
80
115
|
/**
|
|
116
|
+
* @stability unstable
|
|
81
117
|
* @since 4.0.0
|
|
82
118
|
*/
|
|
83
119
|
export * as NodeStdio from "./NodeStdio.ts";
|
|
84
120
|
/**
|
|
121
|
+
* @stability unstable
|
|
85
122
|
* @since 4.0.0
|
|
86
123
|
*/
|
|
87
124
|
export * as NodeStream from "./NodeStream.ts";
|
|
88
125
|
/**
|
|
126
|
+
* @stability unstable
|
|
89
127
|
* @since 4.0.0
|
|
90
128
|
*/
|
|
91
129
|
export * as NodeTerminal from "./NodeTerminal.ts";
|
|
92
130
|
/**
|
|
131
|
+
* @stability unstable
|
|
93
132
|
* @since 4.0.0
|
|
94
133
|
*/
|
|
95
134
|
export * as NodeWorker from "./NodeWorker.ts";
|
|
96
135
|
/**
|
|
136
|
+
* @stability unstable
|
|
97
137
|
* @since 4.0.0
|
|
98
138
|
*/
|
|
99
139
|
export * as NodeWorkerRunner from "./NodeWorkerRunner.ts";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as Layer from "effect/Layer";
|
|
2
|
+
import * as AddressResolver from "effect/net/AddressResolver";
|
|
3
|
+
import type * as Dns from "effect/net/Dns";
|
|
4
|
+
/**
|
|
5
|
+
* Layer that provides the Node.js `AddressResolver` service using the `Dns`
|
|
6
|
+
* service.
|
|
7
|
+
*
|
|
8
|
+
* @stability experimental
|
|
9
|
+
* @category layers
|
|
10
|
+
* @since 4.0.0
|
|
11
|
+
*/
|
|
12
|
+
export declare const layer: Layer.Layer<AddressResolver.AddressResolver, never, Dns.Dns>;
|
|
13
|
+
//# sourceMappingURL=NodeAddressResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../node-shared/NodeAddressResolver.js")
|
|
@@ -19,19 +19,26 @@
|
|
|
19
19
|
* `forceKillAfter`, the wait is limited to one second and never escalates.
|
|
20
20
|
* With it, cleanup may take the configured duration plus a final one-second
|
|
21
21
|
* wait after `SIGKILL`. Zombie descendants can consume either full bound. On
|
|
22
|
-
* Windows, `taskkill` terminates the tree
|
|
22
|
+
* Windows, `taskkill` terminates the tree while the leader is running, and
|
|
23
|
+
* cleanup waits only for the leader's exit. Descendants that outlive the
|
|
24
|
+
* leader are left running.
|
|
23
25
|
*
|
|
26
|
+
* POSIX cleanup targets a numeric process-group ID. If the group disappears
|
|
27
|
+
* and its ID is reused before cleanup, an unrelated group may be signalled.
|
|
28
|
+
*
|
|
29
|
+
* @stability unstable
|
|
24
30
|
* @since 4.0.0
|
|
25
31
|
*/
|
|
26
32
|
import type * as Arr from "effect/Array";
|
|
27
33
|
import * as FileSystem from "effect/FileSystem";
|
|
28
34
|
import * as Layer from "effect/Layer";
|
|
29
35
|
import * as Path from "effect/Path";
|
|
30
|
-
import * as ChildProcess from "effect/
|
|
31
|
-
import { ChildProcessSpawner } from "effect/
|
|
36
|
+
import * as ChildProcess from "effect/process/ChildProcess";
|
|
37
|
+
import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner";
|
|
32
38
|
/**
|
|
33
39
|
* Layer that provides the `NodeChildProcessSpawner` implementation.
|
|
34
40
|
*
|
|
41
|
+
* @stability unstable
|
|
35
42
|
* @category layers
|
|
36
43
|
* @since 4.0.0
|
|
37
44
|
*/
|
|
@@ -39,6 +46,7 @@ export declare const layer: Layer.Layer<ChildProcessSpawner, never, FileSystem.F
|
|
|
39
46
|
/**
|
|
40
47
|
* Result of flattening a pipeline of commands.
|
|
41
48
|
*
|
|
49
|
+
* @stability unstable
|
|
42
50
|
* @category models
|
|
43
51
|
* @since 4.0.0
|
|
44
52
|
*/
|
|
@@ -50,6 +58,7 @@ export interface FlattenedPipeline {
|
|
|
50
58
|
* Flattens a `Command` into an array of `StandardCommand`s along with pipe
|
|
51
59
|
* options for each connection.
|
|
52
60
|
*
|
|
61
|
+
* @stability unstable
|
|
53
62
|
* @category transforming
|
|
54
63
|
* @since 4.0.0
|
|
55
64
|
*/
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node TCP socket transport for Effect Cluster runner-to-runner RPC.
|
|
3
|
+
*
|
|
4
|
+
* This module provides the shared Node layers used by socket-based cluster
|
|
5
|
+
* transports. `layerClientProtocol` opens TCP sockets to peer runner addresses
|
|
6
|
+
* and wraps them in the current RPC serialization protocol. `layerSocketServer`
|
|
7
|
+
* exposes the socket server that receives incoming runner RPC traffic.
|
|
8
|
+
*
|
|
9
|
+
* @stability unstable
|
|
10
|
+
* @since 4.0.0
|
|
11
|
+
*/
|
|
12
|
+
import * as Runners from "effect/cluster/Runners";
|
|
13
|
+
import * as ShardingConfig from "effect/cluster/ShardingConfig";
|
|
1
14
|
import * as Layer from "effect/Layer";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
5
|
-
import type * as SocketServer from "effect/unstable/socket/SocketServer";
|
|
15
|
+
import * as RpcSerialization from "effect/rpc/RpcSerialization";
|
|
16
|
+
import type * as SocketServer from "effect/socket/SocketServer";
|
|
6
17
|
/**
|
|
7
18
|
* Provides the cluster `RpcClientProtocol` by opening TCP sockets to runner
|
|
8
19
|
* addresses and using the current RPC serialization service.
|
|
9
20
|
*
|
|
21
|
+
* @stability unstable
|
|
10
22
|
* @category layers
|
|
11
23
|
* @since 4.0.0
|
|
12
24
|
*/
|
|
@@ -15,6 +27,7 @@ export declare const layerClientProtocol: Layer.Layer<Runners.RpcClientProtocol,
|
|
|
15
27
|
* Provides the socket server used by cluster runners, listening on
|
|
16
28
|
* `ShardingConfig.runnerListenAddress` or `runnerAddress`.
|
|
17
29
|
*
|
|
30
|
+
* @stability unstable
|
|
18
31
|
* @category layers
|
|
19
32
|
* @since 4.0.0
|
|
20
33
|
*/
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* `make` as the concrete service value and `layer` for providing it through
|
|
7
7
|
* Effect context.
|
|
8
8
|
*
|
|
9
|
+
* @stability unstable
|
|
9
10
|
* @since 1.0.0
|
|
10
11
|
*/
|
|
11
12
|
import * as EffectCrypto from "effect/Crypto";
|
|
@@ -13,6 +14,7 @@ import * as Layer from "effect/Layer";
|
|
|
13
14
|
/**
|
|
14
15
|
* The default Node.js Crypto service implementation.
|
|
15
16
|
*
|
|
17
|
+
* @stability unstable
|
|
16
18
|
* @category constructors
|
|
17
19
|
* @since 1.0.0
|
|
18
20
|
*/
|
|
@@ -20,6 +22,7 @@ export declare const make: EffectCrypto.Crypto;
|
|
|
20
22
|
/**
|
|
21
23
|
* Layer that provides the Node.js Crypto service implementation.
|
|
22
24
|
*
|
|
25
|
+
* @stability unstable
|
|
23
26
|
* @category layers
|
|
24
27
|
* @since 1.0.0
|
|
25
28
|
*/
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node UDP adapter for `effect/socket/DatagramSocket`, built on `node:dgram`.
|
|
3
|
+
*
|
|
4
|
+
* `make` opens a new `dgram.Socket` for each reader acquisition, `fromSocket`
|
|
5
|
+
* adopts a socket the caller creates, and `layer` provides the
|
|
6
|
+
* `DatagramSocket` service.
|
|
7
|
+
*
|
|
8
|
+
* The reader owns the native socket, so a send-only client must still acquire
|
|
9
|
+
* a reader, or its writes wait forever. Every write waits for Node's send
|
|
10
|
+
* callback, so send errors fail the write that caused them.
|
|
11
|
+
*
|
|
12
|
+
* `writeAll` fails with the first send error. Which of the other datagrams
|
|
13
|
+
* went out is unspecified and nothing is resent; the error carries the failed
|
|
14
|
+
* datagram's `address`.
|
|
15
|
+
*
|
|
16
|
+
* **Example** (Ingest server)
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { NodeDatagramSocket } from "@effect/platform-node-shared"
|
|
20
|
+
* import { Effect } from "effect"
|
|
21
|
+
* import { DatagramSocket } from "effect/socket"
|
|
22
|
+
*
|
|
23
|
+
* const ingest = Effect.gen(function*() {
|
|
24
|
+
* const socket = yield* DatagramSocket.DatagramSocket
|
|
25
|
+
* const reader = yield* socket.reader
|
|
26
|
+
* while (true) {
|
|
27
|
+
* const datagrams = yield* reader.pull
|
|
28
|
+
* yield* Effect.log(`received ${datagrams.length}, dropped ${reader.dropped()}`)
|
|
29
|
+
* }
|
|
30
|
+
* }).pipe(
|
|
31
|
+
* Effect.scoped,
|
|
32
|
+
* Effect.provide(NodeDatagramSocket.layer({
|
|
33
|
+
* bind: { port: 9000 },
|
|
34
|
+
* receiveBuffer: { capacity: 4096, strategy: "sliding" }
|
|
35
|
+
* }))
|
|
36
|
+
* )
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* **Example** (Echo server)
|
|
40
|
+
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { NodeDatagramSocket } from "@effect/platform-node-shared"
|
|
43
|
+
* import { Effect } from "effect"
|
|
44
|
+
*
|
|
45
|
+
* const echo = Effect.gen(function*() {
|
|
46
|
+
* const socket = yield* NodeDatagramSocket.make({ bind: { port: 9000 } })
|
|
47
|
+
* const reader = yield* socket.reader
|
|
48
|
+
* const writer = yield* socket.writer
|
|
49
|
+
* while (true) {
|
|
50
|
+
* for (const received of yield* reader.pull) {
|
|
51
|
+
* yield* writer.write({ payload: received.payload, address: received })
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
* }).pipe(Effect.scoped)
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* **Example** (Send-only client with a connected socket)
|
|
58
|
+
*
|
|
59
|
+
* ```ts
|
|
60
|
+
* import { NodeDatagramSocket } from "@effect/platform-node-shared"
|
|
61
|
+
* import { Effect } from "effect"
|
|
62
|
+
*
|
|
63
|
+
* const send = (payload: string) =>
|
|
64
|
+
* Effect.gen(function*() {
|
|
65
|
+
* const socket = yield* NodeDatagramSocket.make({
|
|
66
|
+
* connect: { address: "localhost", port: 9000 }
|
|
67
|
+
* })
|
|
68
|
+
* // Required even for send-only clients.
|
|
69
|
+
* yield* socket.reader
|
|
70
|
+
* const writer = yield* socket.writer
|
|
71
|
+
* yield* writer.write({ payload })
|
|
72
|
+
* }).pipe(Effect.scoped)
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* **Example** (Multicast receiver and sender)
|
|
76
|
+
*
|
|
77
|
+
* ```ts
|
|
78
|
+
* import { NodeDatagramSocket } from "@effect/platform-node-shared"
|
|
79
|
+
* import { Effect } from "effect"
|
|
80
|
+
* import { NetAddress } from "effect/net"
|
|
81
|
+
*
|
|
82
|
+
* const group = NetAddress.ipFromStringUnsafe("239.255.0.1")
|
|
83
|
+
*
|
|
84
|
+
* const receive = Effect.gen(function*() {
|
|
85
|
+
* if (!NetAddress.isMulticast(group) || !NetAddress.isIpv4Address(group)) return
|
|
86
|
+
* const socket = yield* NodeDatagramSocket.make({
|
|
87
|
+
* bind: { address: "0.0.0.0", port: 5000 },
|
|
88
|
+
* reuseAddress: true
|
|
89
|
+
* })
|
|
90
|
+
* const reader = yield* socket.reader
|
|
91
|
+
* yield* reader.joinMulticast({ group, interface: NetAddress.ipv4Loopback })
|
|
92
|
+
* return yield* reader.pull
|
|
93
|
+
* }).pipe(Effect.scoped)
|
|
94
|
+
*
|
|
95
|
+
* const announce = Effect.gen(function*() {
|
|
96
|
+
* const socket = yield* NodeDatagramSocket.make({
|
|
97
|
+
* peer: { address: group, port: 5000 },
|
|
98
|
+
* // Egress interface, independent of the join's ingress interface.
|
|
99
|
+
* multicast: { interface: NetAddress.ipv4Loopback, ttl: 1, loopback: true }
|
|
100
|
+
* })
|
|
101
|
+
* yield* socket.reader
|
|
102
|
+
* const writer = yield* socket.writer
|
|
103
|
+
* yield* writer.write({ payload: "hello" })
|
|
104
|
+
* }).pipe(Effect.scoped)
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @stability experimental
|
|
108
|
+
* @since 4.0.0
|
|
109
|
+
*/
|
|
110
|
+
import * as Effect from "effect/Effect";
|
|
111
|
+
import * as Layer from "effect/Layer";
|
|
112
|
+
import * as NetAddress from "effect/net/NetAddress";
|
|
113
|
+
import type * as Scope from "effect/Scope";
|
|
114
|
+
import * as DatagramSocket from "effect/socket/DatagramSocket";
|
|
115
|
+
import * as Dgram from "node:dgram";
|
|
116
|
+
/**
|
|
117
|
+
* An open-time endpoint. Hostnames resolve once per reader acquisition via
|
|
118
|
+
* `node:dns.lookup`.
|
|
119
|
+
* An `InetAddress` can be passed directly.
|
|
120
|
+
*
|
|
121
|
+
* @stability experimental
|
|
122
|
+
* @category models
|
|
123
|
+
* @since 4.0.0
|
|
124
|
+
*/
|
|
125
|
+
export interface Endpoint {
|
|
126
|
+
readonly address: string | NetAddress.IpAddress;
|
|
127
|
+
readonly port: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The local address and port to bind. Defaults to `0.0.0.0` (or `::` for
|
|
131
|
+
* `family: "ipv6"`) and an ephemeral port.
|
|
132
|
+
*
|
|
133
|
+
* @stability experimental
|
|
134
|
+
* @category models
|
|
135
|
+
* @since 4.0.0
|
|
136
|
+
*/
|
|
137
|
+
export interface BindOptions {
|
|
138
|
+
readonly address?: string | NetAddress.IpAddress | undefined;
|
|
139
|
+
readonly port?: number | undefined;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Options for `make` and `layer`.
|
|
143
|
+
*
|
|
144
|
+
* **Details**
|
|
145
|
+
*
|
|
146
|
+
* `peer` is a default destination and doesn't filter senders. `connect` calls
|
|
147
|
+
* `connect(2)` after binding, so the kernel filters senders and ICMP errors
|
|
148
|
+
* reach `onError`. The two can't be combined.
|
|
149
|
+
*
|
|
150
|
+
* Family selection, in order: explicit `family`, a `bind` IP literal, the
|
|
151
|
+
* `peer` or `connect` address, a `bind` hostname, then `"ipv4"`. Hostname
|
|
152
|
+
* lookups use the family selected so far, or prefer IPv4 if none is set.
|
|
153
|
+
*
|
|
154
|
+
* `reuseAddress` means `SO_REUSEADDR` on Linux and `SO_REUSEPORT` on BSD and
|
|
155
|
+
* macOS. `kernelReceiveBufferSize` and `kernelSendBufferSize` are in bytes;
|
|
156
|
+
* Linux doubles the value and caps it at `rmem_max` / `wmem_max`.
|
|
157
|
+
*
|
|
158
|
+
* `multicast.interface` is the egress interface for datagrams sent to a group,
|
|
159
|
+
* which is a different socket option from the ingress `interface` of
|
|
160
|
+
* `Reader.joinMulticast`.
|
|
161
|
+
*
|
|
162
|
+
* @stability experimental
|
|
163
|
+
* @category models
|
|
164
|
+
* @since 4.0.0
|
|
165
|
+
*/
|
|
166
|
+
export type Options = {
|
|
167
|
+
readonly bind?: BindOptions | undefined;
|
|
168
|
+
readonly family?: "ipv4" | "ipv6" | undefined;
|
|
169
|
+
readonly reuseAddress?: boolean | undefined;
|
|
170
|
+
readonly reusePort?: boolean | undefined;
|
|
171
|
+
readonly ipv6Only?: boolean | undefined;
|
|
172
|
+
readonly kernelReceiveBufferSize?: number | undefined;
|
|
173
|
+
readonly kernelSendBufferSize?: number | undefined;
|
|
174
|
+
readonly broadcast?: boolean | undefined;
|
|
175
|
+
readonly ttl?: number | undefined;
|
|
176
|
+
readonly multicast?: {
|
|
177
|
+
readonly interface?: NetAddress.MulticastInterface | undefined;
|
|
178
|
+
readonly loopback?: boolean | undefined;
|
|
179
|
+
readonly ttl?: number | undefined;
|
|
180
|
+
} | undefined;
|
|
181
|
+
readonly receiveBuffer?: DatagramSocket.ReceiveBufferOptions | undefined;
|
|
182
|
+
readonly onError?: ((error: DatagramSocket.DatagramSocketError) => void) | undefined;
|
|
183
|
+
} & ({
|
|
184
|
+
readonly peer?: Endpoint | undefined;
|
|
185
|
+
readonly connect?: undefined;
|
|
186
|
+
} | {
|
|
187
|
+
readonly connect: Endpoint;
|
|
188
|
+
readonly peer?: undefined;
|
|
189
|
+
});
|
|
190
|
+
/**
|
|
191
|
+
* Options for `fromSocket`. The caller configures the adopted socket, so only
|
|
192
|
+
* the options that live in JavaScript apply.
|
|
193
|
+
*
|
|
194
|
+
* @stability experimental
|
|
195
|
+
* @category models
|
|
196
|
+
* @since 4.0.0
|
|
197
|
+
*/
|
|
198
|
+
export interface FromSocketOptions {
|
|
199
|
+
readonly peer?: Endpoint | undefined;
|
|
200
|
+
readonly receiveBuffer?: DatagramSocket.ReceiveBufferOptions | undefined;
|
|
201
|
+
readonly onError?: ((error: DatagramSocket.DatagramSocketError) => void) | undefined;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Creates a `DatagramSocket` that opens and binds a new `dgram.Socket` for
|
|
205
|
+
* each reader acquisition.
|
|
206
|
+
*
|
|
207
|
+
* **Details**
|
|
208
|
+
*
|
|
209
|
+
* Creating the socket never fails. Binding, applying options and resolving
|
|
210
|
+
* names happen when a reader is acquired, and fail that acquisition with a
|
|
211
|
+
* `DatagramSocketError`. Hostnames in `bind`, `peer` and `connect` are
|
|
212
|
+
* resolved once per acquisition, so the native socket only sees IP literals
|
|
213
|
+
* and no send waits for DNS.
|
|
214
|
+
*
|
|
215
|
+
* Invalid `receiveBuffer.capacity` values cause a defect; use a positive
|
|
216
|
+
* safe integer.
|
|
217
|
+
*
|
|
218
|
+
* @stability experimental
|
|
219
|
+
* @category constructors
|
|
220
|
+
* @since 4.0.0
|
|
221
|
+
*/
|
|
222
|
+
export declare const make: (options?: Options) => Effect.Effect<DatagramSocket.DatagramSocket>;
|
|
223
|
+
/**
|
|
224
|
+
* Adopts a `dgram.Socket`.
|
|
225
|
+
*
|
|
226
|
+
* **Details**
|
|
227
|
+
*
|
|
228
|
+
* `acquire` runs once per reader acquisition, inside the reader's scope, and
|
|
229
|
+
* the adapter closes the socket when that scope ends. The socket must be bound
|
|
230
|
+
* by the time `acquire` completes. Whether it is connected is checked once at
|
|
231
|
+
* open.
|
|
232
|
+
*
|
|
233
|
+
* @stability experimental
|
|
234
|
+
* @category constructors
|
|
235
|
+
* @since 4.0.0
|
|
236
|
+
*/
|
|
237
|
+
export declare const fromSocket: <R>(acquire: Effect.Effect<Dgram.Socket, DatagramSocket.DatagramSocketError, R>, options?: FromSocketOptions) => Effect.Effect<DatagramSocket.DatagramSocket, never, Exclude<R, Scope.Scope>>;
|
|
238
|
+
/**
|
|
239
|
+
* Provides a `DatagramSocket` built with `make`.
|
|
240
|
+
*
|
|
241
|
+
* @stability experimental
|
|
242
|
+
* @category layers
|
|
243
|
+
* @since 4.0.0
|
|
244
|
+
*/
|
|
245
|
+
export declare const layer: (options?: Options) => Layer.Layer<DatagramSocket.DatagramSocket>;
|
|
246
|
+
//# sourceMappingURL=NodeDatagramSocket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../node-shared/NodeDatagramSocket.js")
|