From 021fdf06bb215a6736c45714ce760850c7f81de6 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 28 May 2023 11:38:05 +0200 Subject: [PATCH] Remove unneeded spawningFacet field; mark StopOnRetract entities --- packages/core/src/runtime/actor.ts | 5 ++++- packages/core/src/runtime/task.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core/src/runtime/actor.ts b/packages/core/src/runtime/actor.ts index 14062b1..f781193 100644 --- a/packages/core/src/runtime/actor.ts +++ b/packages/core/src/runtime/actor.ts @@ -249,10 +249,13 @@ export class Facet { } } +export const STOP_ON_RETRACT = Symbol('stop-on-retract'); // NB. NOT A GLOBAL SYMBOL + export class StopOnRetract implements Partial { retract(_handle: Handle): void { Turn.active.stop(); } + data = STOP_ON_RETRACT; } export function _sync_impl(e: Partial, peer: Ref): void { @@ -359,7 +362,7 @@ export class Turn { describe() { return { type: 'bootActor', detail }; }, }); }, - { type: 'spawnActor', detail, spawningFacet, initialAssertions }); + { type: 'spawnActor', detail, initialAssertions }); return newActor; } diff --git a/packages/core/src/runtime/task.ts b/packages/core/src/runtime/task.ts index 5fd1cfb..15fb068 100644 --- a/packages/core/src/runtime/task.ts +++ b/packages/core/src/runtime/task.ts @@ -21,7 +21,7 @@ export type TaskDescription = export type TaskAction = { targetFacet: Facet, action: ActionDescription }; export type ActionDescription = - | { type: 'spawnActor', detail?: AnyValue, spawningFacet: Facet, initialAssertions: IdentitySet } + | { type: 'spawnActor', detail?: AnyValue, initialAssertions: IdentitySet } | { type: 'stopActor', err?: AnyValue } | { type: 'inertCheck' }