effect-machine 0.2.2 → 0.2.3
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 +4 -2
package/package.json
CHANGED
package/src/actor.ts
CHANGED
|
@@ -520,8 +520,10 @@ export const createActor = Effect.fn("effect-machine.actor.spawn")(function* <
|
|
|
520
520
|
return buildActorRefCore(id, machine, stateRef, eventQueue, stoppedRef, listeners, stop);
|
|
521
521
|
}
|
|
522
522
|
|
|
523
|
-
// Start the event loop
|
|
524
|
-
|
|
523
|
+
// Start the event loop — use forkScoped so the event loop fiber's lifetime
|
|
524
|
+
// is tied to the provided Scope, not the calling fiber. This prevents the
|
|
525
|
+
// event loop from being interrupted when a transient caller completes.
|
|
526
|
+
const loopFiber = yield* Effect.forkScoped(
|
|
525
527
|
eventLoop(
|
|
526
528
|
machine,
|
|
527
529
|
stateRef,
|