Make turns atomic, rather than reply-turn-per-event

This commit is contained in:
Tony Garnock-Jones 2021-05-31 12:01:33 +02:00
parent 5085abfcbf
commit 9a06f4a633
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ export class Turn {
const t = new Turn(facet);
try {
f(t);
t.queues!.forEach((q, facet) => queueTask(() => q.forEach(f => Turn.for(facet, f))));
t.queues!.forEach((q, facet) => queueTask(() => Turn.for(facet, t=> q.forEach(f => f(t)))));
t.queues = null;
} catch (err) {
Turn.for(facet.actor.root, t => facet.actor.terminateWith(t, { ok: false, err }));