@typeonce/effect-machine 0.44.0 → 0.45.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/dist/Machine.d.ts +20 -5
- package/dist/Machine.d.ts.map +1 -1
- package/dist/Machine.js.map +1 -1
- package/dist/internal/machine/atom.d.ts.map +1 -1
- package/dist/internal/machine/atom.js +13 -5
- package/dist/internal/machine/atom.js.map +1 -1
- package/dist/internal/machine/process.d.ts.map +1 -1
- package/dist/internal/machine/process.js +103 -55
- package/dist/internal/machine/process.js.map +1 -1
- package/dist/internal/machine/runtimeCompiled.d.ts.map +1 -1
- package/dist/internal/machine/runtimeCompiled.js +112 -17
- package/dist/internal/machine/runtimeCompiled.js.map +1 -1
- package/dist/internal/machine/runtimeGeneric.d.ts.map +1 -1
- package/dist/internal/machine/runtimeGeneric.js +11 -19
- package/dist/internal/machine/runtimeGeneric.js.map +1 -1
- package/dist/internal/machine/runtimeProtocol.d.ts +52 -2
- package/dist/internal/machine/runtimeProtocol.d.ts.map +1 -1
- package/dist/internal/machine/runtimeProtocol.js +61 -0
- package/dist/internal/machine/runtimeProtocol.js.map +1 -1
- package/package.json +1 -1
- package/src/Machine.ts +20 -5
- package/src/internal/machine/atom.ts +26 -18
- package/src/internal/machine/process.ts +115 -64
- package/src/internal/machine/runtimeCompiled.ts +128 -26
- package/src/internal/machine/runtimeGeneric.ts +20 -22
- package/src/internal/machine/runtimeProtocol.ts +114 -6
package/dist/Machine.d.ts
CHANGED
|
@@ -367,6 +367,10 @@ export interface Runtime<in Events, in Emits> {
|
|
|
367
367
|
/**
|
|
368
368
|
* Minimal typed target accepted by inter-machine send commands.
|
|
369
369
|
*
|
|
370
|
+
* `send` reports whether the event was accepted for delivery. It promises
|
|
371
|
+
* nothing about when the target processes it; a local {@link MachineRef}
|
|
372
|
+
* strengthens that guarantee.
|
|
373
|
+
*
|
|
370
374
|
* @category models
|
|
371
375
|
* @since 0.12.0
|
|
372
376
|
*/
|
|
@@ -1156,10 +1160,17 @@ export interface Prepared<out State, in Event, out Error, out Output, out Emitte
|
|
|
1156
1160
|
*
|
|
1157
1161
|
* **Gotchas**
|
|
1158
1162
|
*
|
|
1159
|
-
* `send` reports whether an event was accepted for delivery.
|
|
1160
|
-
*
|
|
1161
|
-
*
|
|
1162
|
-
* `
|
|
1163
|
+
* `send` reports whether an event was accepted for delivery. A running
|
|
1164
|
+
* machine reference is local, so an idle machine processes an accepted event
|
|
1165
|
+
* in the sender's turn: work that completes without suspending is reflected
|
|
1166
|
+
* by `snapshot` when `send` returns. Work that suspends continues in the
|
|
1167
|
+
* background, and an event sent while the machine is processing is queued
|
|
1168
|
+
* behind the current work. `changes` subscribers receive every committed
|
|
1169
|
+
* snapshot in order once the sender yields, with consecutive sends delivered
|
|
1170
|
+
* together. This guarantee belongs to `MachineRef`; a `MachineTarget` only
|
|
1171
|
+
* promises delivery. Errors that occur while processing an accepted event are
|
|
1172
|
+
* observed through `snapshot`, `changes`, or `join`. Sending after
|
|
1173
|
+
* termination fails with `StoppedError`.
|
|
1163
1174
|
*
|
|
1164
1175
|
* @category models
|
|
1165
1176
|
* @since 0.4.0
|
|
@@ -1184,7 +1195,11 @@ export interface MachineRef<out State, in Event, out Error = never, out Output =
|
|
|
1184
1195
|
readonly join: Effect.Effect<Output, Error | StoppedError>;
|
|
1185
1196
|
/** Stops this machine instance and its owned child processes. */
|
|
1186
1197
|
readonly stop: Effect.Effect<void>;
|
|
1187
|
-
/**
|
|
1198
|
+
/**
|
|
1199
|
+
* Accepts an event for processing by this local machine. An idle machine
|
|
1200
|
+
* processes it in the sender's turn until the work first suspends, so
|
|
1201
|
+
* `snapshot` reflects it when `send` returns.
|
|
1202
|
+
*/
|
|
1188
1203
|
readonly send: (event: Event) => Effect.Effect<void, StoppedError>;
|
|
1189
1204
|
/**
|
|
1190
1205
|
* Returns the current directly owned child for a typed descriptor.
|