@typeonce/effect-machine 0.43.0 → 0.45.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/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. Errors that occur
1160
- * while asynchronously processing an accepted event are observed through
1161
- * `snapshot`, `changes`, or `join`. Sending after termination fails with
1162
- * `StoppedError`.
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
- /** Accepts an event for asynchronous processing by the running machine. */
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.