@procedures/client 0.9.2 → 0.10.0

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 CHANGED
@@ -1,5 +1,32 @@
1
1
  # @procedures/client
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 254ee7b: `ProcedureServer` has stop parts in the shape of the runner of `@mark1russell7/service`, and its storages are dependency handles (server stack CLI-5, decision D2). This change is a break of the server stack, thus it is its own MINOR (decision D13).
8
+
9
+ - New methods of `ProcedureServer`: `stopIntake()`, `drain(deadline, signal)`, `inFlight()` and `close()`. The server is a `TransportImpl` of the runner by its shape, and the types are structural: the root and `./browser` import no code of the runner.
10
+ - `stopIntake()` refuses each new call with a retryable `UNAVAILABLE`, and ends each subscription of `events.subscribe`. The calls in flight continue.
11
+ - `drain(deadline, signal)` waits until no call is in flight, or until the deadline on the clock of the server. When the signal aborts, each call that still runs gets the abort. The drain uses only the clock of the server, with no timer of its own.
12
+ - `close()` aborts each call that still runs and stops the transports of the server. The intake stays stopped until the next `start()`, and a second close gives the same promise. `close()` does not close the storages.
13
+ - New `storageHandles()`: one `StorageHandle` for each storage, also for a storage of two collections. A handle is a `DependencyHandle` of the runner by its shape: `connect` does nothing, and `close` closes the storage and removes its collections. The runner closes the handles after the transports close.
14
+ - `start()` opens the intake again after `close()`, and the next calls get a new signal.
15
+ - `stop({ grace })` is the parts in the sequence of the stages: `stopIntake()`, `drain()` for the grace, `close()`, and then `closeStorages()`. The server can start again, as before.
16
+ - New exported types: `StopParts` and `StorageHandle`, from the root, `./browser` and `./server`.
17
+ - `callsInFlight` is deprecated. Use `inFlight()`, which gives the same count.
18
+
19
+ The behavior that changes:
20
+
21
+ - The grace of `stop({ grace })` waits on the option `clock` of the server. Before, it waited on `setTimeout`. A test that gives a fake clock and stops with a grace must advance the clock.
22
+ - During `stop()`, the intake stays stopped until the storages close. Before, a call that came while the transports stopped could start, and then find a closed storage.
23
+
24
+ Migration steps:
25
+
26
+ - The site, MiniMongo and the MCP host of Graph: no change is necessary. `stop({ grace })` keeps its result. Change `server.callsInFlight` to `server.inFlight()`.
27
+ - jarvis and Graph under `run()`: declare the parts in the service of the process. Do not call `stop()`. Declare `svc.server("procedures", {}, server)`, and declare each handle of `server.storageHandles()` with `svc.dependency(handle.name, spec, handle)`. Give the server and `run()` the same clock, with the option `clock` of each.
28
+ - A test with a fake clock that calls `stop({ grace })` with calls in flight: advance the clock by the grace, or stop without a grace.
29
+
3
30
  ## 0.9.2
4
31
 
5
32
  No changes in this release.