Send Err outside Turn

This commit is contained in:
Tony Garnock-Jones 2019-06-08 21:50:11 +01:00
parent af3c4bfe2d
commit 5c94433a85
2 changed files with 8 additions and 4 deletions

View File

@ -313,7 +313,8 @@ spawn named '@syndicate-lang/server/federation/ScopeFactory' {
field this.linkMatches = Map();
const err = (detail) => {
turn.extend(W.Err(detail));
send P.Proposal(managementScope, P.ToPOA(linkid, W.Err(detail)));
turn.reset();
currentFacet().stop();
};

View File

@ -13,12 +13,15 @@ export function recorder(fields, fieldName, onCommit) {
function commit() {
if (fields[fieldName]) {
onCommit(items);
items = [];
fields[fieldName] = false;
reset();
}
}
function reset() {
items = [];
fields[fieldName] = false;
}
field fields[fieldName] = false;
currentFacet().addDataflow(commit, PRIORITY.IDLE);
return { extend, commit };
return { extend, commit, reset };
}