This commit is contained in:
Tony Garnock-Jones 2021-02-22 21:08:14 +01:00
parent 4c5f896ecf
commit 4c0e2b448e
1 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ export class Ref<T> {
}
}
export type OutboundMap = Map<Handle, [Ref<Entity>, Assertion]>;
export type OutboundMap = Map<Handle, Ref<Entity>>;
export class Actor {
readonly outbound: OutboundMap;
@ -47,7 +47,7 @@ export class Actor {
terminateWith(t: Turn, reason: Exclude<ExitReason, null>) {
if (this.alive) {
this.exitReason = reason;
this.outbound.forEach(([peer, _a], h) => t._retract(peer, h));
this.outbound.forEach((peer, h) => t._retract(peer, h));
}
}
@ -116,14 +116,14 @@ export class Turn {
assert(location: Ref<Entity>, assertion: Assertion): Handle {
const h = nextHandle++;
this.enqueue(location.actor, t => {
this._ensureActor("assert").outbound.set(h, [location, assertion]);
this._ensureActor("assert").outbound.set(h, location);
location.target[assert]?.(t, assertion, h);
});
return h;
}
retract(h: Handle): void {
this._retract(this._ensureActor("retract").outbound.get(h)![0], h);
this._retract(this._ensureActor("retract").outbound.get(h)!, h);
}
replace(location: Ref<Entity>, h: Handle | undefined, assertion: Assertion): Handle {