* Refactor `util.ts` to use `existing.ready` instead of `existing._channel.ready` and replace `existing.ready` with `rpc.ready`.
This commit is contained in:
parent
7386b6de05
commit
a7e0fbd190
|
@ -118,14 +118,14 @@ export function createHash(data: string): Buffer {
|
||||||
export async function setupStream(stream: any) {
|
export async function setupStream(stream: any) {
|
||||||
const existing = stream[RPC_PROTOCOL_SYMBOL];
|
const existing = stream[RPC_PROTOCOL_SYMBOL];
|
||||||
if (existing) {
|
if (existing) {
|
||||||
await existing._channel.ready;
|
await existing.ready;
|
||||||
return existing;
|
return existing;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rpc = new RPC(stream);
|
const rpc = new RPC(stream);
|
||||||
stream[RPC_PROTOCOL_SYMBOL] = rpc;
|
stream[RPC_PROTOCOL_SYMBOL] = rpc;
|
||||||
|
|
||||||
await existing.ready;
|
await rpc.ready;
|
||||||
|
|
||||||
return rpc;
|
return rpc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue