effect-machine 0.3.0 → 0.3.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/package.json +1 -1
- package/src/actor.ts +8 -0
package/package.json
CHANGED
package/src/actor.ts
CHANGED
|
@@ -84,6 +84,13 @@ export interface ActorRef<State extends { readonly _tag: string }, Event> {
|
|
|
84
84
|
*/
|
|
85
85
|
readonly stop: Effect.Effect<void>;
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Stop the actor (fire-and-forget).
|
|
89
|
+
* Signals graceful shutdown without waiting for completion.
|
|
90
|
+
* Use when stopping from sync contexts (e.g. framework cleanup hooks).
|
|
91
|
+
*/
|
|
92
|
+
readonly stopSync: () => void;
|
|
93
|
+
|
|
87
94
|
/**
|
|
88
95
|
* Get current state snapshot (Effect)
|
|
89
96
|
*/
|
|
@@ -422,6 +429,7 @@ export const buildActorRefCore = <
|
|
|
422
429
|
send,
|
|
423
430
|
state: stateRef,
|
|
424
431
|
stop,
|
|
432
|
+
stopSync: () => Effect.runFork(stop),
|
|
425
433
|
snapshot,
|
|
426
434
|
snapshotSync: () => Effect.runSync(SubscriptionRef.get(stateRef)),
|
|
427
435
|
matches,
|