@procedures/peer 0.11.0 → 0.12.1
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/CHANGELOG.md +43 -0
- package/README.md +1 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/host/index.d.ts +10 -0
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.js +5 -1
- package/dist/host/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lockfile.d.ts +14 -0
- package/dist/lockfile.d.ts.map +1 -1
- package/dist/lockfile.js +16 -0
- package/dist/lockfile.js.map +1 -1
- package/package.json +3 -3
- package/src/host/index.ts +16 -1
- package/src/index.ts +1 -0
- package/src/lockfile.ts +24 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @procedures/peer
|
|
2
2
|
|
|
3
|
+
## 0.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9fccd90: `createProcedureHost()` has the new option `controller` (server stack CLI-45). `controller.requires` names the dependencies of the service that each call of the host needs. `host.controllers` gives them, and `host.declare(svc)` declares them on the controller of the host. While a check of one of them fails readiness, the service refuses each call with `UNAVAILABLE`, which a caller can send again. Without the option, the controller needs no dependency, as before.
|
|
8
|
+
|
|
9
|
+
jarvis needs this option: its procedure calls need its world store.
|
|
10
|
+
- Updated dependencies [b89e3fe]
|
|
11
|
+
- @procedures/client@0.12.1
|
|
12
|
+
|
|
13
|
+
## 0.12.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 9ea2030: `runProcedureHost()` of `@procedures/server` is the one runner entry on `run()` of `@mark1russell7/service`, for `procedure-server`, `mark serve` and `mark --server` (server stack CLI-8, decisions D6, D7 and D17). This change is a break of the server stack, thus it is its own MINOR (decision D13).
|
|
18
|
+
|
|
19
|
+
- New `runProcedureHost({ name, host, mode, profile, lockfile, log, run })`. It declares the parts of `createProcedureHost()` in one service, and starts `run()`. It gives `{ host, service, life }` when the startup ends.
|
|
20
|
+
- The mode `foreground` has the profile `localDev`: a second Ctrl-C exits at once. The mode `background` has the profile `daemon`: a repeat signal has no effect. Each run declares `onRepeatSignal`. `HOST_PROFILES` gives the profiles as data.
|
|
21
|
+
- The caps of the stages sum to 10 s. They replace the hard-exit timer of 10 s of the entries.
|
|
22
|
+
- The lockfile is a dependency of the service: its connect writes it before the listeners start, and its close removes it after the listeners close. New `lockfileHandle(data)` of `@procedures/peer/lockfile`.
|
|
23
|
+
- `runServer()` (the bin `procedure-server` and `mark serve`) and `startServerMode()` (`mark --server`) install no signal handler and no hard-exit timer. Their promise ends with the lifecycle.
|
|
24
|
+
- `mark --server` is the background host (decision D17). `procedure-server` and `mark serve` run in the foreground.
|
|
25
|
+
- The entries map their transports to a host with `peerHostOptions()` of `@procedures/peer` (CLI-7).
|
|
26
|
+
- `ServerRunOptions.run` and the second argument of `startServerMode()` take the options of `run()`, for a test: a process port and a clock.
|
|
27
|
+
- A random token of `procedure-server` has 32 bytes, as the token of `mark --server`.
|
|
28
|
+
- The one-shot commands of `mark` keep their interrupt. CLI-26 moves them under `run()`.
|
|
29
|
+
|
|
30
|
+
The behavior that changes:
|
|
31
|
+
|
|
32
|
+
- A second Ctrl-C of `mark --server` has no effect: the host ends its drain, in 10 s at most. A second Ctrl-C of `procedure-server` and `mark serve` exits at once with the code 1, as before.
|
|
33
|
+
- The process exits with the code of the lifecycle: 0 after a clean shutdown, and 1 after an error or a startup that failed.
|
|
34
|
+
- A random token of `procedure-server` has 64 hexadecimal characters, not 48.
|
|
35
|
+
|
|
36
|
+
Migration steps:
|
|
37
|
+
|
|
38
|
+
- The site, MiniMongo, Graph and jarvis: no change is necessary. They do not start these entries.
|
|
39
|
+
- A script that starts `procedure-server` or `mark serve` and stops it with a signal: no change is necessary. Wait for the exit, in 10 s at most.
|
|
40
|
+
- A program that embeds the server outside a service: use `startServer()`, which starts it as a peer, and `peer.stop()`.
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- @procedures/client@0.12.0
|
|
45
|
+
|
|
3
46
|
## 0.11.0
|
|
4
47
|
|
|
5
48
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -140,6 +140,7 @@ await svc.run();
|
|
|
140
140
|
- **The faces.** `http` and `ws` are the faces of this package (`httpFace()`, `wsFace()`). `mcp` takes `mcpFace()` of `@procedures/mcp-server`. A face of another package is a function with the same shape.
|
|
141
141
|
- **The listeners.** The faces of a listener mount on its mount list, so they share one port. Without `listen`, the app mounts `host.handler` and `host.upgrade` on its own listener.
|
|
142
142
|
- **The request tracking.** Each call goes through `life.request`, with the route `<face> <procedure>`. The function of the pattern gives the idempotency of each call: a repeatable procedure, a keyed call, or a call that runs one time (decision D3).
|
|
143
|
+
- **The readiness of the calls.** The option `controller.requires` names the dependencies of the service that each call needs. While a check of one of them fails readiness, the service refuses each call with `UNAVAILABLE` (CLI-45).
|
|
143
144
|
- **The streams.** Each call is a stream, and a unary call is a stream of one (decision D4). A stream stays in flight until its end. A cut after the first item ends the stream with an error line.
|
|
144
145
|
- **The collections.** The option `collections` gives the storages. The host serves `collections.<name>.*` for each one.
|
|
145
146
|
- **No `/health` route.** The probes come from the runner (`probeHandler` or `probeServer`). A client checks a lockfile with `host.info` and the token of the lockfile.
|