This commit is contained in:
Tony Garnock-Jones 2019-06-07 15:48:59 +01:00
parent 9ad7b25bcb
commit 18ba7a05cf
1 changed files with 7 additions and 8 deletions

View File

@ -55,12 +55,11 @@ export function _genericClientSessionFacet(addr, scope, w0, debug) {
w0(x); w0(x);
}; };
const outboundTurn = Turn.recorder(this, 'commitNeeded', const outboundTurn = Turn.recorder(this, 'commitNeeded', {
{ extend: w,
extend: w, commit: () => { w(Commit()); },
commit: () => { w(Commit()); }, debug: debug
debug: debug });
});
const inboundTurn = Turn.replayer({ debug: debug }); const inboundTurn = Turn.replayer({ debug: debug });
on start w(Connect(scope)); on start w(Connect(scope));
@ -81,10 +80,10 @@ export function _genericClientSessionFacet(addr, scope, w0, debug) {
on stop outboundTurn.extend(Clear(ep)); on stop outboundTurn.extend(Clear(ep));
on message _ServerPacket(addr, Add(ep, $vs)) inboundTurn.extend(() => { on message _ServerPacket(addr, Add(ep, $vs)) inboundTurn.extend(() => {
react { react {
const epFacet = currentFacet(); const assertionFacet = currentFacet();
assert Skeleton.instantiateAssertion(FromServer(addr, spec), vs); assert Skeleton.instantiateAssertion(FromServer(addr, spec), vs);
on message _ServerPacket(addr, Del(ep, vs)) inboundTurn.extend(() => { on message _ServerPacket(addr, Del(ep, vs)) inboundTurn.extend(() => {
epFacet.stop(); assertionFacet.stop();
}); });
} }
}) })