Correct usages of `stop` to conform to new semantics
This commit is contained in:
parent
2bcffd3bab
commit
31f11d2389
|
@ -22,8 +22,8 @@ export function service(handler: (args: AnyValue) => void, options?: ServiceOpti
|
||||||
packetWriter: (bs: Uint8Array) => process.stdout.write(bs),
|
packetWriter: (bs: Uint8Array) => process.stdout.write(bs),
|
||||||
setup(r: Relay.Relay) {
|
setup(r: Relay.Relay) {
|
||||||
process.stdin.on('data', bs => facet.turn(() => r.accept(new Uint8Array(bs))));
|
process.stdin.on('data', bs => facet.turn(() => r.accept(new Uint8Array(bs))));
|
||||||
process.stdin.on('close', () => facet.turn(() => { stop {} }));
|
process.stdin.on('close', () => facet.turn(() => { stop facet; }));
|
||||||
process.stdin.on('end', () => facet.turn(() => { stop {} }));
|
process.stdin.on('end', () => facet.turn(() => { stop facet; }));
|
||||||
},
|
},
|
||||||
initialRef: Turn.ref(assertionFacetObserver(handler)),
|
initialRef: Turn.ref(assertionFacetObserver(handler)),
|
||||||
}, options ?? {}));
|
}, options ?? {}));
|
||||||
|
|
|
@ -64,7 +64,7 @@ export function boot(ds = Dataspace.global, debug: boolean = false, WebSocketCon
|
||||||
message(a0: Assertion): void {
|
message(a0: Assertion): void {
|
||||||
const a = G.toTransportControl(a0);
|
const a = G.toTransportControl(a0);
|
||||||
if (!a) return;
|
if (!a) return;
|
||||||
stop {} // ForceDisconnect
|
stop facet; // ForceDisconnect
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let final = false;
|
let final = false;
|
||||||
|
@ -76,7 +76,7 @@ export function boot(ds = Dataspace.global, debug: boolean = false, WebSocketCon
|
||||||
console.log('closing', addr.url);
|
console.log('closing', addr.url);
|
||||||
ws.close();
|
ws.close();
|
||||||
}
|
}
|
||||||
ws.onclose = () => facet.turn(() => { stop {} });
|
ws.onclose = () => facet.turn(() => { stop facet; });
|
||||||
ws.onerror = () => facet.turn(() =>
|
ws.onerror = () => facet.turn(() =>
|
||||||
Turn.active.crash(new Error("WebSocket error")));
|
Turn.active.crash(new Error("WebSocket error")));
|
||||||
const relay = new Relay.Relay({
|
const relay = new Relay.Relay({
|
||||||
|
@ -109,7 +109,7 @@ export function boot(ds = Dataspace.global, debug: boolean = false, WebSocketCon
|
||||||
"resolved": G.Resolved.Rejected(G.Rejected(detail)),
|
"resolved": G.Resolved.Rejected(G.Rejected(detail)),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setTimeout(() => facet.turn(() => { stop {} }), 10000);
|
setTimeout(() => facet.turn(() => { stop facet; }), 10000);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const ws = new (WebSocketConstructor ?? WebSocket)(addr.url);
|
const ws = new (WebSocketConstructor ?? WebSocket)(addr.url);
|
||||||
|
|
Loading…
Reference in New Issue