@zukhruf/rpc 0.8.190 → 0.8.192
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 +47 -14
- package/dist/call/client.d.ts +2 -2
- package/dist/call/client.d.ts.map +1 -1
- package/dist/call/client.js +5 -7
- package/dist/call/client.js.map +1 -1
- package/dist/call/pending-calls.d.ts +5 -6
- package/dist/call/pending-calls.d.ts.map +1 -1
- package/dist/call/pending-calls.js +6 -8
- package/dist/call/pending-calls.js.map +1 -1
- package/dist/call/server.d.ts +10 -5
- package/dist/call/server.d.ts.map +1 -1
- package/dist/call/server.js +18 -16
- package/dist/call/server.js.map +1 -1
- package/dist/connection/connection-supervisor.d.ts +6 -6
- package/dist/connection/connection-supervisor.d.ts.map +1 -1
- package/dist/connection/connection-supervisor.js +16 -13
- package/dist/connection/connection-supervisor.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ The words in these documents have one meaning each. See the glossary in [CONTEXT
|
|
|
10
10
|
npm install @zukhruf/rpc
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
The host starts a worker thread and calls its `greet` method. The thread serves the method on its port.
|
|
13
|
+
The host starts a worker thread and calls its `greet` method. The thread serves the method on its port, and calls the host's `log` on the same link.
|
|
14
14
|
|
|
15
15
|
```ts title="host.ts"
|
|
16
16
|
import { Worker } from 'node:worker_threads';
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
ConnectionSupervisor,
|
|
21
21
|
ErrorCodec,
|
|
22
22
|
type RpcMessage,
|
|
23
|
+
Server,
|
|
23
24
|
WorkerConnection,
|
|
24
25
|
} from '@zukhruf/rpc';
|
|
25
26
|
|
|
@@ -33,6 +34,16 @@ const link = new ConnectionSupervisor<RpcMessage>({
|
|
|
33
34
|
tag: '@greeter',
|
|
34
35
|
}),
|
|
35
36
|
});
|
|
37
|
+
new Server(
|
|
38
|
+
{ log: (line: string) => console.log(line) },
|
|
39
|
+
{
|
|
40
|
+
methods: {
|
|
41
|
+
log: (params): params is [string] =>
|
|
42
|
+
params.length === 1 && typeof params[0] === 'string',
|
|
43
|
+
},
|
|
44
|
+
errors: new ErrorCodec([]),
|
|
45
|
+
},
|
|
46
|
+
).serve(link);
|
|
36
47
|
await using client = new Client<Greeter>(link, {
|
|
37
48
|
errors: new ErrorCodec([]),
|
|
38
49
|
answers: { greet: (answer): answer is string => typeof answer === 'string' },
|
|
@@ -43,10 +54,21 @@ console.log(await client.call('greet', ['Ada']));
|
|
|
43
54
|
```ts title="greeter.ts"
|
|
44
55
|
import { parentPort } from 'node:worker_threads';
|
|
45
56
|
|
|
46
|
-
import {
|
|
57
|
+
import {
|
|
58
|
+
Client,
|
|
59
|
+
ConnectionSupervisor,
|
|
60
|
+
ErrorCodec,
|
|
61
|
+
ParentPortConnection,
|
|
62
|
+
type RpcMessage,
|
|
63
|
+
Server,
|
|
64
|
+
} from '@zukhruf/rpc';
|
|
47
65
|
|
|
48
|
-
const connection = new ParentPortConnection(parentPort!, {
|
|
49
|
-
|
|
66
|
+
const connection = new ParentPortConnection<RpcMessage>(parentPort!, {
|
|
67
|
+
tag: '@greeter',
|
|
68
|
+
});
|
|
69
|
+
const link = new ConnectionSupervisor<RpcMessage>({
|
|
70
|
+
connect: async () => connection,
|
|
71
|
+
});
|
|
50
72
|
new Server(
|
|
51
73
|
{ greet: (name: string) => `Hello, ${name}` },
|
|
52
74
|
{
|
|
@@ -56,9 +78,18 @@ new Server(
|
|
|
56
78
|
},
|
|
57
79
|
errors: new ErrorCodec([]),
|
|
58
80
|
},
|
|
59
|
-
).serve(
|
|
81
|
+
).serve(link);
|
|
82
|
+
const host = new Client<{ log(line: string): void }>(link, {
|
|
83
|
+
errors: new ErrorCodec([]),
|
|
84
|
+
answers: { log: (answer): answer is void => answer === undefined },
|
|
85
|
+
});
|
|
86
|
+
await host.call('log', ['The greeter is ready']);
|
|
60
87
|
```
|
|
61
88
|
|
|
89
|
+
The thread stays alive after its call to `log`: the server holds the link while it serves, and the client holds it only while a call waits (ADR 0004).
|
|
90
|
+
|
|
91
|
+
````
|
|
92
|
+
|
|
62
93
|
## Call a method of the other end
|
|
63
94
|
|
|
64
95
|
`client.call(method, params, { signal })` sends a request and waits for its answer. The answer is checked by the client's `answers` check of that method before the call gives it its type: it comes from another thread or process (mutex ADR 0017). A call made while no connection is open goes on the next one. A call that went out on a connection that is lost rejects at once with `ConnectionLostError`, and it is not sent again: the peer may have run it, as a lost Postgres commit may have committed. A call whose `signal` aborts rejects with the signal's reason, and a later answer settles nothing.
|
|
@@ -67,13 +98,15 @@ new Server(
|
|
|
67
98
|
|
|
68
99
|
## Serve the methods of an object
|
|
69
100
|
|
|
70
|
-
`server.serve(
|
|
101
|
+
`server.serve(link)` opens the supervisor `link` and answers each request on it with the value of the method, or with the error that it threw. It serves only the methods that `methods` names, each with the check of its parameters: a method of the target with no check is refused, as is a request whose parameters fail the check. The server holds the link while it serves, as a listening `net.Server` keeps the process alive: until the link is closed or unavailable. An answer that does not reach the link is dropped, because its caller is gone. A notification's method that throws emits a `ServerWarning` (`ZUKHRUF_RPC_NOTIFICATION_FAILED`), because nothing answers a notification.
|
|
71
102
|
|
|
72
|
-
Each end can run a `Client` and a `Server` on one
|
|
103
|
+
Each end can run a `Client` and a `Server` on one link, as StreamJsonRpc's `JsonRpc` does: the client reads the responses and the server reads the requests.
|
|
73
104
|
|
|
74
105
|
## Keep a connection across a loss
|
|
75
106
|
|
|
76
|
-
`ConnectionSupervisor` keeps one connection open at a time. It connects on `open`, replaces a connection that is lost, and stops for good when its `Connector` gives `undefined`. It emits `connected`, `message`, `disconnected`, `unavailable` and `failed`.
|
|
107
|
+
`ConnectionSupervisor` keeps one connection open at a time. It connects on `open`, replaces a connection that is lost, and stops for good when its `Connector` gives `undefined`. It emits `connected`, `message`, `disconnected`, `unavailable` and `failed`.
|
|
108
|
+
|
|
109
|
+
`link.hold()` keeps the process alive through the open connection, and each one that replaces it, until the token it gives is disposed. The supervisor counts the holds of everyone who works on the link, so the release of one does not unref the work of another. A supervisor that nobody holds lets the process exit, as an unref'd socket does (ADR 0004).
|
|
77
110
|
|
|
78
111
|
## Decide what happens to a call that was in flight
|
|
79
112
|
|
|
@@ -85,7 +118,7 @@ Each end can run a `Client` and a `Server` on one connection, as StreamJsonRpc's
|
|
|
85
118
|
| `{ atLoss }` | The call leaves the table at the loss, and `atLoss` settles it. | `Client`: `ConnectionLostError` |
|
|
86
119
|
| `{ atReconnect }` | The call waits, unsent, and `atReconnect` settles it when the next connection opens. A reconnect that fails or cannot come rejects it with the other calls. | The mutex's try: busy |
|
|
87
120
|
|
|
88
|
-
A call
|
|
121
|
+
A call holds the link from its add until it is taken, so the process exits only when no call, and no other holder of the link, waits.
|
|
89
122
|
|
|
90
123
|
## Carry errors across
|
|
91
124
|
|
|
@@ -147,12 +180,11 @@ export class ConnectionSupervisor<
|
|
|
147
180
|
readonly status: SupervisorStatus;
|
|
148
181
|
open(): void;
|
|
149
182
|
send(message: Outgoing): boolean;
|
|
150
|
-
|
|
151
|
-
unref(): void;
|
|
183
|
+
hold(): Disposable;
|
|
152
184
|
close(): Promise<void>;
|
|
153
185
|
}
|
|
154
186
|
export class PendingCalls<Request, Answer> {
|
|
155
|
-
constructor(link: ConnectionSupervisor<Request
|
|
187
|
+
constructor(link: ConnectionSupervisor<Request>);
|
|
156
188
|
add(
|
|
157
189
|
id: string,
|
|
158
190
|
request: Request,
|
|
@@ -186,18 +218,19 @@ export class Server<Local extends Methods<Local>> {
|
|
|
186
218
|
target: Local,
|
|
187
219
|
options: { methods: ParamChecks<Local>; errors: ErrorCodec },
|
|
188
220
|
);
|
|
189
|
-
serve(
|
|
221
|
+
serve(link: ConnectionSupervisor<RpcMessage>): void;
|
|
190
222
|
}
|
|
191
223
|
export class ErrorCodec {
|
|
192
224
|
constructor(classes: readonly ErrorClass[]);
|
|
193
225
|
encode(reason: unknown): EncodedReason;
|
|
194
226
|
decode(encoded: EncodedReason): unknown;
|
|
195
227
|
}
|
|
196
|
-
|
|
228
|
+
````
|
|
197
229
|
|
|
198
230
|
## Documentation
|
|
199
231
|
|
|
200
232
|
- [ADR 0001](./docs/adr/0001-a-lost-call-follows-the-policy-that-its-caller-gives.md): a lost call follows the policy that its caller gives.
|
|
201
233
|
- [ADR 0002](./docs/adr/0002-an-error-crosses-as-data-and-is-rebuilt-from-a-list-of-classes-without-its-constructor.md): an error crosses as data and is rebuilt from a list of classes, without its constructor.
|
|
202
234
|
- [ADR 0003](./docs/adr/0003-each-end-checks-what-it-receives.md): each end checks what it receives.
|
|
235
|
+
- [ADR 0004](./docs/adr/0004-a-link-has-one-count-of-holds.md): a link has one count of holds.
|
|
203
236
|
- [Copied code](./docs/copied-code.md)
|
package/dist/call/client.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export interface CallOptions {
|
|
|
15
15
|
* Calls the methods of a peer's `Server` over a supervised connection. A
|
|
16
16
|
* call waits for its answer, or rejects with `ConnectionLostError` as soon as
|
|
17
17
|
* the connection it went out on is lost. A call made while no connection is
|
|
18
|
-
* open goes on the next one. The
|
|
19
|
-
*
|
|
18
|
+
* open goes on the next one. The client holds the connection only while a
|
|
19
|
+
* call or a notification waits, so it keeps the process alive no longer.
|
|
20
20
|
*/
|
|
21
21
|
export declare class Client<Remote extends Methods<Remote>> implements AsyncDisposable {
|
|
22
22
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/call/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EACL,KAAK,UAAU,EAKhB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,aAAa,CAAC,MAAM,SAA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,CAAC,CAAC,CAAC,CAAC,EAC7B,EAAE,MAAM,EAAE,GAAE,WAAgB,GAC3B,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAmBzC;IAED;;;;OAIG;IACH,MAAM,CAAC,CAAC,SAAS,MAAM,MAAM,GAAG,MAAM,EACpC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAO9B;IAED,sFAAsF;IAChF,CAAC,MAAM,CAAC,YAAY,CAAC,kBAI1B;CA+BF"}
|
package/dist/call/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { untilAborted } from '@zukhruf/async';
|
|
2
2
|
import { ConnectionLostError } from '../error/connection-lost-error.js';
|
|
3
3
|
import { PendingCalls } from './pending-calls.js';
|
|
4
4
|
import { isRpcResponse, } from './rpc-message.js';
|
|
@@ -10,13 +10,12 @@ const rejectLost = {
|
|
|
10
10
|
* Calls the methods of a peer's `Server` over a supervised connection. A
|
|
11
11
|
* call waits for its answer, or rejects with `ConnectionLostError` as soon as
|
|
12
12
|
* the connection it went out on is lost. A call made while no connection is
|
|
13
|
-
* open goes on the next one. The
|
|
14
|
-
*
|
|
13
|
+
* open goes on the next one. The client holds the connection only while a
|
|
14
|
+
* call or a notification waits, so it keeps the process alive no longer.
|
|
15
15
|
*/
|
|
16
16
|
export class Client {
|
|
17
17
|
#link;
|
|
18
18
|
#errors;
|
|
19
|
-
#refs;
|
|
20
19
|
#answers;
|
|
21
20
|
#calls;
|
|
22
21
|
/** The notifications made while no connection was open, each with the hold that keeps the process alive until it goes. */
|
|
@@ -26,8 +25,7 @@ export class Client {
|
|
|
26
25
|
this.#link = link;
|
|
27
26
|
this.#errors = errors;
|
|
28
27
|
this.#answers = answers;
|
|
29
|
-
this.#
|
|
30
|
-
this.#calls = new PendingCalls(link, this.#refs);
|
|
28
|
+
this.#calls = new PendingCalls(link);
|
|
31
29
|
link.on('connected', () => {
|
|
32
30
|
this.#flush();
|
|
33
31
|
this.#calls.resume();
|
|
@@ -71,7 +69,7 @@ export class Client {
|
|
|
71
69
|
this.#link.open();
|
|
72
70
|
if (this.#outbox.length === 0 && this.#link.send(notification))
|
|
73
71
|
return;
|
|
74
|
-
this.#outbox.push({ notification, held: this.#
|
|
72
|
+
this.#outbox.push({ notification, held: this.#link.hold() });
|
|
75
73
|
}
|
|
76
74
|
/** Closes the connection. Each call that waits rejects with `ConnectionLostError`. */
|
|
77
75
|
async [Symbol.asyncDispose]() {
|
package/dist/call/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/call/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/call/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAGxE,OAAO,EAAuB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAKL,aAAa,GACd,MAAM,kBAAkB,CAAC;AAa1B,sFAAsF;AACtF,MAAM,UAAU,GAA4B;IAC1C,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,mBAAmB,EAAE,CAAC;CACzD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,OAAO,MAAM;IACR,KAAK,CAAmC;IACxC,OAAO,CAAa;IACpB,QAAQ,CAAuB;IAC/B,MAAM,CAAoC;IACnD,0HAA0H;IAC1H,OAAO,GAA0D,EAAE,CAAC;IACpE,OAAO,GAAG,CAAC,CAAC;IAEZ,YACE,IAAsC,EACtC,EAAE,MAAM,EAAE,OAAO,EAAyB;QAE1C,IAAI,CAAC,KAAK,GAAG,IAAI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ount } from '@zukhruf/async';
|
|
2
1
|
import type { ConnectionSupervisor } from '../connection/connection-supervisor.ts';
|
|
3
2
|
/** What settles the promise of one call; the caller keeps the promise. */
|
|
4
3
|
export interface Settler<Answer> {
|
|
@@ -36,14 +35,14 @@ export interface TakenCall<Request, Answer> extends Settler<Answer> {
|
|
|
36
35
|
* The calls that wait for an answer over a supervised connection, by id. A
|
|
37
36
|
* call goes out when it is added, or on the next connection when none is
|
|
38
37
|
* open. The owner reports each loss and each new connection, so it can send
|
|
39
|
-
* its own messages first (a reassertion, a marker). A call
|
|
40
|
-
* connection
|
|
41
|
-
*
|
|
38
|
+
* its own messages first (a reassertion, a marker). A call holds the
|
|
39
|
+
* connection from its add until it is taken, so the process exits only when
|
|
40
|
+
* no call, and no other holder of the connection, waits.
|
|
42
41
|
*/
|
|
43
42
|
export declare class PendingCalls<Request, Answer> {
|
|
44
43
|
#private;
|
|
45
|
-
/**
|
|
46
|
-
constructor(link: ConnectionSupervisor<Request
|
|
44
|
+
/** Each call holds `link`, so one owner's last call does not unref the work of another owner of the link. */
|
|
45
|
+
constructor(link: ConnectionSupervisor<Request>);
|
|
47
46
|
/** Opens the connection and sends `request`, or keeps it for the next connection. One id is one call. */
|
|
48
47
|
add(id: string, request: Request, onLost: LostCallPolicy<Answer>): Promise<Answer>;
|
|
49
48
|
/** The request of the call that waits under `id`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-calls.d.ts","sourceRoot":"","sources":["../../src/call/pending-calls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"pending-calls.d.ts","sourceRoot":"","sources":["../../src/call/pending-calls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,0EAA0E;AAC1E,MAAM,WAAW,OAAO,CAAC,MAAM;IAC7B,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IA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;IAED,SAAS,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,QAK9C;CAKF"}
|
|
@@ -4,18 +4,16 @@ const sent = { kind: 'sent' };
|
|
|
4
4
|
* The calls that wait for an answer over a supervised connection, by id. A
|
|
5
5
|
* call goes out when it is added, or on the next connection when none is
|
|
6
6
|
* open. The owner reports each loss and each new connection, so it can send
|
|
7
|
-
* its own messages first (a reassertion, a marker). A call
|
|
8
|
-
* connection
|
|
9
|
-
*
|
|
7
|
+
* its own messages first (a reassertion, a marker). A call holds the
|
|
8
|
+
* connection from its add until it is taken, so the process exits only when
|
|
9
|
+
* no call, and no other holder of the connection, waits.
|
|
10
10
|
*/
|
|
11
11
|
export class PendingCalls {
|
|
12
12
|
#link;
|
|
13
|
-
#refs;
|
|
14
13
|
#calls = new Map();
|
|
15
|
-
/**
|
|
16
|
-
constructor(link
|
|
14
|
+
/** Each call holds `link`, so one owner's last call does not unref the work of another owner of the link. */
|
|
15
|
+
constructor(link) {
|
|
17
16
|
this.#link = link;
|
|
18
|
-
this.#refs = refs;
|
|
19
17
|
}
|
|
20
18
|
/** Opens the connection and sends `request`, or keeps it for the next connection. One id is one call. */
|
|
21
19
|
add(id, request, onLost) {
|
|
@@ -28,7 +26,7 @@ export class PendingCalls {
|
|
|
28
26
|
onLost,
|
|
29
27
|
delivery: queued,
|
|
30
28
|
settler: { resolve, reject },
|
|
31
|
-
held: this.#
|
|
29
|
+
held: this.#link.hold(),
|
|
32
30
|
};
|
|
33
31
|
this.#calls.set(id, call);
|
|
34
32
|
this.#link.open();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-calls.js","sourceRoot":"","sources":["../../src/call/pending-calls.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pending-calls.js","sourceRoot":"","sources":["../../src/call/pending-calls.ts"],"names":[],"mappings":"AA0CA,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAW,CAAC;AAC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;YACrC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM;gBAAE,SAAS;YAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;YACxB,IAAI,MAAM,KAAK,QAAQ;gBAAE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;iBAC3C,IAAI,QAAQ,IAAI,MAAM;gBAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAE,CAAC,CAAC;;gBACtD,IAAI,CAAC,QAAQ,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;QACzE,CAAC;IACH,CAAC;IAED,SAAS,CAAC,MAAqC;QAC7C,KAAK,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED,SAAS,CAAC,IAA8B;QACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IAChE,CAAC;CACF"}
|
package/dist/call/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConnectionSupervisor } from '../connection/connection-supervisor.ts';
|
|
2
2
|
import type { ErrorCodec } from '../error/error-codec.ts';
|
|
3
3
|
import type { Methods, ParamChecks } from './methods.ts';
|
|
4
4
|
import { type RpcMessage } from './rpc-message.ts';
|
|
@@ -12,13 +12,18 @@ export interface ServerOptions<Local extends Methods<Local>> {
|
|
|
12
12
|
* Answers the calls that peers make of `target`. It answers each request with
|
|
13
13
|
* the method's value or the error it threw, and runs each notification
|
|
14
14
|
* without an answer. A message that is not a call is not the server's, so it
|
|
15
|
-
* is ignored. Serving
|
|
16
|
-
*
|
|
15
|
+
* is ignored. Serving holds the connection, so the process stays alive to
|
|
16
|
+
* hear the next call, as a listening `net.Server` does.
|
|
17
17
|
*/
|
|
18
18
|
export declare class Server<Local extends Methods<Local>> {
|
|
19
19
|
#private;
|
|
20
20
|
constructor(target: Local, { methods, errors }: ServerOptions<Local>);
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Opens `link` and answers the calls that arrive on it, on the open
|
|
23
|
+
* connection and each one that replaces it. It holds `link` for good, as a
|
|
24
|
+
* listening `net.Server` holds its handle: the hold ends with the link, since
|
|
25
|
+
* a link that is closed or unavailable has no connection left to ref.
|
|
26
|
+
*/
|
|
27
|
+
serve(link: ConnectionSupervisor<RpcMessage>): void;
|
|
23
28
|
}
|
|
24
29
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/call/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/call/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EACL,KAAK,UAAU,EAIhB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,aAAa,CAAC,KAAK,SAAS,OAAO,CAAC,KAAK,CAAC;IACzD,mJAAmJ;IACnJ,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,6EAA6E;IAC7E,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;GAMG;AACH,qBAAa,MAAM,CAAC,KAAK,SAAS,OAAO,CAAC,KAAK,CAAC;;IAQ9C,YAAY,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,KAAK,CAAC,EAInE;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,oBAAoB,CAAC,UAAU,CAAC,QAS3C;CAuCF"}
|
package/dist/call/server.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { ConnectionClosedError } from '../connection/connection-closed-error.js';
|
|
2
1
|
import { ServerWarning } from '../error/server-warning.js';
|
|
3
2
|
import { isRpcCall, } from './rpc-message.js';
|
|
4
3
|
/**
|
|
5
4
|
* Answers the calls that peers make of `target`. It answers each request with
|
|
6
5
|
* the method's value or the error it threw, and runs each notification
|
|
7
6
|
* without an answer. A message that is not a call is not the server's, so it
|
|
8
|
-
* is ignored. Serving
|
|
9
|
-
*
|
|
7
|
+
* is ignored. Serving holds the connection, so the process stays alive to
|
|
8
|
+
* hear the next call, as a listening `net.Server` does.
|
|
10
9
|
*/
|
|
11
10
|
export class Server {
|
|
12
11
|
#target;
|
|
@@ -17,20 +16,27 @@ export class Server {
|
|
|
17
16
|
this.#methods = new Map(Object.entries(methods));
|
|
18
17
|
this.#errors = errors;
|
|
19
18
|
}
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Opens `link` and answers the calls that arrive on it, on the open
|
|
21
|
+
* connection and each one that replaces it. It holds `link` for good, as a
|
|
22
|
+
* listening `net.Server` holds its handle: the hold ends with the link, since
|
|
23
|
+
* a link that is closed or unavailable has no connection left to ref.
|
|
24
|
+
*/
|
|
25
|
+
serve(link) {
|
|
26
|
+
// Never released: a closed or unavailable link refs nothing.
|
|
27
|
+
link.hold();
|
|
28
|
+
link.on('message', (message) => {
|
|
23
29
|
if (!isRpcCall(message))
|
|
24
30
|
return;
|
|
25
31
|
if (message.id === undefined)
|
|
26
32
|
void this.#run(message);
|
|
27
33
|
else
|
|
28
|
-
void this.#answer(
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
connection.once('close', () => connection.off('message', onMessage));
|
|
34
|
+
void this.#answer(link, message);
|
|
35
|
+
});
|
|
36
|
+
link.open();
|
|
32
37
|
}
|
|
33
|
-
|
|
38
|
+
/** A send that does not reach the link drops the answer: the caller is gone, and nobody waits for it. */
|
|
39
|
+
async #answer(link, request) {
|
|
34
40
|
let response;
|
|
35
41
|
try {
|
|
36
42
|
response = { id: request.id, result: await this.#invoke(request) };
|
|
@@ -38,11 +44,7 @@ export class Server {
|
|
|
38
44
|
catch (error) {
|
|
39
45
|
response = { id: request.id, error: this.#errors.encode(error) };
|
|
40
46
|
}
|
|
41
|
-
|
|
42
|
-
// The caller is gone; nobody waits for the answer.
|
|
43
|
-
if (!(error instanceof ConnectionClosedError))
|
|
44
|
-
throw error;
|
|
45
|
-
});
|
|
47
|
+
link.send(response);
|
|
46
48
|
}
|
|
47
49
|
async #run(notification) {
|
|
48
50
|
try {
|
package/dist/call/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/call/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/call/server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAIL,SAAS,GACV,MAAM,kBAAkB,CAAC;AAS1B;;;;;;GAMG;AACH,MAAM,OAAO,MAAM;IACR,OAAO,CAAQ;IACf,QAAQ,CAGf;IACO,OAAO,CAAa;IAE7B,YAAY,MAAa,EAAE,EAAE,OAAO,EAAE,MAAM,EAAwB;QAClE,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,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AE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE,CAAC,CAC1D,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EACZ,MAAM,EACN,MAAM,GACgC;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,GAAG,GAAY,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAChE,IAAI,CAAC,KAAK,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;YACxC,MAAM,IAAI,SAAS,CAAC,6BAA6B,MAAM,IAAI,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACnB,MAAM,IAAI,SAAS,CACjB,sBAAsB,MAAM,mCAAmC,CAChE,CAAC;QACJ,CAAC;QACD,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACF"}
|
|
@@ -27,13 +27,13 @@ export declare class ConnectionSupervisor<Outgoing> extends EventEmitter<Supervi
|
|
|
27
27
|
/** Whether `message` was handed to an open connection. A failed delivery is reported as a loss. */
|
|
28
28
|
send(message: Outgoing): boolean;
|
|
29
29
|
/**
|
|
30
|
-
* Keeps the process alive through the open connection and each one that
|
|
31
|
-
* replaces it, until
|
|
32
|
-
*
|
|
30
|
+
* Keeps the process alive through the open connection, and each one that
|
|
31
|
+
* replaces it, until the token is disposed. The link is ref'd while any
|
|
32
|
+
* token is out, so one holder's release does not unref another's work. A
|
|
33
|
+
* supervisor that nobody holds lets the process exit, as an unref'd socket
|
|
34
|
+
* does.
|
|
33
35
|
*/
|
|
34
|
-
|
|
35
|
-
/** Lets the process exit while the open connection, or one that replaces it, waits. */
|
|
36
|
-
unref(): void;
|
|
36
|
+
hold(): Disposable;
|
|
37
37
|
/** Closes for good, after any connect still on its way has stopped. */
|
|
38
38
|
close(): Promise<void>;
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-supervisor.d.ts","sourceRoot":"","sources":["../../src/connection/connection-supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAC1B,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,SAAS,EAAE,EAAE,CAAC;IACd,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5B,wGAAwG;IACxG,YAAY,EAAE,EAAE,CAAC;IACjB,6CAA6C;IAC7C,WAAW,EAAE,EAAE,CAAC;IAChB,kEAAkE;IAClE,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;CAC1B;AAED;;;;;GAKG;AACH,qBAAa,oBAAoB,CAC/B,QAAQ,CACR,SAAQ,YAAY,CAAC,gBAAgB,CAAC;;IAGtC,YAAY,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EAGzC;IAED,IAAI,MAAM,IAAI,gBAAgB,CAE7B;IAED,mFAAmF;IACnF,IAAI,SAEH;IAED,mGAAmG;IACnG,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAE/B;IAED
|
|
1
|
+
{"version":3,"file":"connection-supervisor.d.ts","sourceRoot":"","sources":["../../src/connection/connection-supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAC1B,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,SAAS,EAAE,EAAE,CAAC;IACd,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5B,wGAAwG;IACxG,YAAY,EAAE,EAAE,CAAC;IACjB,6CAA6C;IAC7C,WAAW,EAAE,EAAE,CAAC;IAChB,kEAAkE;IAClE,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;CAC1B;AAED;;;;;GAKG;AACH,qBAAa,oBAAoB,CAC/B,QAAQ,CACR,SAAQ,YAAY,CAAC,gBAAgB,CAAC;;IAGtC,YAAY,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EAGzC;IAED,IAAI,MAAM,IAAI,gBAAgB,CAE7B;IAED,mFAAmF;IACnF,IAAI,SAEH;IAED,mGAAmG;IACnG,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAE/B;IAED;;;;;;OAMG;IACH,IAAI,IAAI,UAAU,CAEjB;IAED,uEAAuE;IACvE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAErB;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
|
-
import { Latch } from '@zukhruf/async';
|
|
2
|
+
import { Latch, RefCount } from '@zukhruf/async';
|
|
3
3
|
/**
|
|
4
4
|
* Keeps one connection open at a time. It connects on `open`, replaces a
|
|
5
5
|
* connection that is lost, and stops for good when its connector has no peer
|
|
@@ -24,16 +24,14 @@ export class ConnectionSupervisor extends EventEmitter {
|
|
|
24
24
|
return this.#supervision.state.send(message);
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* Keeps the process alive through the open connection and each one that
|
|
28
|
-
* replaces it, until
|
|
29
|
-
*
|
|
27
|
+
* Keeps the process alive through the open connection, and each one that
|
|
28
|
+
* replaces it, until the token is disposed. The link is ref'd while any
|
|
29
|
+
* token is out, so one holder's release does not unref another's work. A
|
|
30
|
+
* supervisor that nobody holds lets the process exit, as an unref'd socket
|
|
31
|
+
* does.
|
|
30
32
|
*/
|
|
31
|
-
|
|
32
|
-
this.#supervision.
|
|
33
|
-
}
|
|
34
|
-
/** Lets the process exit while the open connection, or one that replaces it, waits. */
|
|
35
|
-
unref() {
|
|
36
|
-
this.#supervision.refer(letExit);
|
|
33
|
+
hold() {
|
|
34
|
+
return this.#supervision.holds.hold();
|
|
37
35
|
}
|
|
38
36
|
/** Closes for good, after any connect still on its way has stopped. */
|
|
39
37
|
close() {
|
|
@@ -42,13 +40,18 @@ export class ConnectionSupervisor extends EventEmitter {
|
|
|
42
40
|
}
|
|
43
41
|
const keepAlive = (connection) => connection.ref();
|
|
44
42
|
const letExit = (connection) => connection.unref();
|
|
45
|
-
/** What the states share: the current state, the
|
|
43
|
+
/** What the states share: the current state, the holds on the link, and how to move to the next state. */
|
|
46
44
|
class Supervision {
|
|
47
45
|
connector;
|
|
48
46
|
events;
|
|
49
47
|
state;
|
|
50
|
-
/**
|
|
51
|
-
reference =
|
|
48
|
+
/** Whether a hold is out. Each new connection takes it on, whatever its adapter starts with. */
|
|
49
|
+
reference = letExit;
|
|
50
|
+
/** The one count of the link: its first hold refs the link, and the release of its last unrefs it. */
|
|
51
|
+
holds = new RefCount({
|
|
52
|
+
ref: () => this.refer(keepAlive),
|
|
53
|
+
unref: () => this.refer(letExit),
|
|
54
|
+
});
|
|
52
55
|
constructor(connector, events) {
|
|
53
56
|
this.connector = connector;
|
|
54
57
|
this.events = events;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-supervisor.js","sourceRoot":"","sources":["../../src/connection/connection-supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAkB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"connection-supervisor.js","source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Ed,KAAK,CAAC,KAAK,KAAI,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/rpc",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.192",
|
|
4
4
|
"description": "Calls between threads and processes over a worker, a port or an IPC channel: a supervised connection, calls that reject at once when the peer goes or go again, and errors that keep their class and fields. After Go's net/rpc and .NET's StreamJsonRpc.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@zukhruf/async": "^0.8.
|
|
45
|
+
"@zukhruf/async": "^0.8.192"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@zukhruf/testing": "^0.8.
|
|
48
|
+
"@zukhruf/testing": "^0.8.192"
|
|
49
49
|
}
|
|
50
50
|
}
|