From f8e6fc4ab6db68a75d5f93f91b62a3a846981dcb Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 23 Feb 2021 11:09:41 +0100 Subject: [PATCH] Tighten --- actor.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/actor.ts b/actor.ts index 279fe50..0a6de6f 100644 --- a/actor.ts +++ b/actor.ts @@ -40,19 +40,15 @@ export class Actor { this.outbound = initialAssertions; } - get alive(): boolean { - return this.exitReason === null; - } - terminateWith(t: Turn, reason: Exclude) { - if (!this.alive) return; + if (this.exitReason !== null) return; this.exitReason = reason; this.outbound.forEach((peer, h) => t._retract(peer, h)); } execute(proc: () => void): void { queueMicrotask(() => { - if (!this.alive) return; + if (this.exitReason !== null) return; try { proc(); } catch (err) {