@actuallab/rpc 13.0.12 → 13.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -577,7 +577,7 @@ var RpcWebSocketConnection = class {
|
|
|
577
577
|
return this._ws.readyState === WebSocketState.OPEN;
|
|
578
578
|
}
|
|
579
579
|
get whenConnected() {
|
|
580
|
-
return this._connected
|
|
580
|
+
return this._connected;
|
|
581
581
|
}
|
|
582
582
|
send(serializedMessage) {
|
|
583
583
|
this._sendRaw(serializedMessage);
|
|
@@ -1149,7 +1149,7 @@ var RpcStreamSender = class _RpcStreamSender {
|
|
|
1149
1149
|
* src/ActualLab.Rpc/Infrastructure/RpcSharedStream.cs.
|
|
1150
1150
|
*/
|
|
1151
1151
|
async writeFrom(source) {
|
|
1152
|
-
await this._started
|
|
1152
|
+
await this._started;
|
|
1153
1153
|
if (this._ended) return;
|
|
1154
1154
|
const iterator = source[Symbol.asyncIterator]();
|
|
1155
1155
|
this._iterator = iterator;
|
|
@@ -1348,7 +1348,7 @@ var RpcStreamSender = class _RpcStreamSender {
|
|
|
1348
1348
|
async _waitAckReady() {
|
|
1349
1349
|
if (this._acks.length > 0 || this._ended) return;
|
|
1350
1350
|
this._whenAckReady = new import_core5.PromiseSource();
|
|
1351
|
-
await this._whenAckReady
|
|
1351
|
+
await this._whenAckReady;
|
|
1352
1352
|
this._whenAckReady = null;
|
|
1353
1353
|
}
|
|
1354
1354
|
// -- IRpcObject --
|
|
@@ -1670,7 +1670,7 @@ var RpcStream = class _RpcStream {
|
|
|
1670
1670
|
return { value: void 0, done: true };
|
|
1671
1671
|
}
|
|
1672
1672
|
this._consumerWaiting = new import_core6.PromiseSource();
|
|
1673
|
-
await this._consumerWaiting
|
|
1673
|
+
await this._consumerWaiting;
|
|
1674
1674
|
}
|
|
1675
1675
|
},
|
|
1676
1676
|
return: () => {
|
|
@@ -2454,7 +2454,7 @@ var RpcPeer = class {
|
|
|
2454
2454
|
this._sendWireData(outboundCall.serializedWireData);
|
|
2455
2455
|
};
|
|
2456
2456
|
this.connectionStateChanged.add(stateHandler);
|
|
2457
|
-
outboundCall.result.
|
|
2457
|
+
outboundCall.result.then(() => this.connectionStateChanged.remove(stateHandler)).catch(() => this.connectionStateChanged.remove(stateHandler));
|
|
2458
2458
|
}
|
|
2459
2459
|
const signal = options?.signal;
|
|
2460
2460
|
if (signal !== void 0) {
|
|
@@ -2467,7 +2467,7 @@ var RpcPeer = class {
|
|
|
2467
2467
|
}
|
|
2468
2468
|
};
|
|
2469
2469
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
2470
|
-
outboundCall.result.
|
|
2470
|
+
outboundCall.result.then(() => signal.removeEventListener("abort", onAbort)).catch(() => signal.removeEventListener("abort", onAbort));
|
|
2471
2471
|
}
|
|
2472
2472
|
return outboundCall;
|
|
2473
2473
|
}
|
|
@@ -2789,7 +2789,7 @@ var RpcClientPeer = class extends RpcPeer {
|
|
|
2789
2789
|
whenClosed.resolve(ev);
|
|
2790
2790
|
closedController.abort();
|
|
2791
2791
|
});
|
|
2792
|
-
const closedRejection = whenClosed.
|
|
2792
|
+
const closedRejection = whenClosed.then(() => {
|
|
2793
2793
|
throw new Error("Connection failed");
|
|
2794
2794
|
});
|
|
2795
2795
|
closedRejection.catch(() => {
|
|
@@ -2827,7 +2827,7 @@ var RpcClientPeer = class extends RpcPeer {
|
|
|
2827
2827
|
let remoteHandshake;
|
|
2828
2828
|
try {
|
|
2829
2829
|
remoteHandshake = await (0, import_core7.withTimeout)(
|
|
2830
|
-
Promise.race([this._pendingHandshake
|
|
2830
|
+
Promise.race([this._pendingHandshake, closedRejection]),
|
|
2831
2831
|
handshakeTimeoutMs,
|
|
2832
2832
|
"Handshake timeout"
|
|
2833
2833
|
);
|
|
@@ -2856,7 +2856,7 @@ var RpcClientPeer = class extends RpcPeer {
|
|
|
2856
2856
|
this._setConnectionState(3 /* Connected */);
|
|
2857
2857
|
this._tryIndex = 0;
|
|
2858
2858
|
await this._reconnect(isPeerChanged, closedController.signal);
|
|
2859
|
-
await whenClosed
|
|
2859
|
+
await whenClosed;
|
|
2860
2860
|
} catch (e) {
|
|
2861
2861
|
debugLog2?.log(`'${this.ref}': run() iteration failed:`, e);
|
|
2862
2862
|
}
|
|
@@ -2996,7 +2996,7 @@ var RpcClientPeer = class extends RpcPeer {
|
|
|
2996
2996
|
signal: closedSignal
|
|
2997
2997
|
}
|
|
2998
2998
|
);
|
|
2999
|
-
const result = await reconnectCall.result
|
|
2999
|
+
const result = await reconnectCall.result;
|
|
3000
3000
|
const bytes = _toBytes2(result);
|
|
3001
3001
|
if (bytes === null) return new Set(eligible.map((c) => c.callId));
|
|
3002
3002
|
return new Set(IncreasingSeqCompressor.deserialize(bytes));
|
|
@@ -3881,7 +3881,7 @@ var RpcHub = class {
|
|
|
3881
3881
|
throw new Error("Outbound call failed: not connected and AwaitForConnection is not set.");
|
|
3882
3882
|
const callArgs = args.slice(0, methodDef.argCount);
|
|
3883
3883
|
const outboundCall = peer.call(wireName, callArgs);
|
|
3884
|
-
const result = await outboundCall.result
|
|
3884
|
+
const result = await outboundCall.result;
|
|
3885
3885
|
const ref = parseStreamRef(result);
|
|
3886
3886
|
if (!ref)
|
|
3887
3887
|
throw new Error(
|
|
@@ -3898,7 +3898,7 @@ var RpcHub = class {
|
|
|
3898
3898
|
throw new Error("Outbound call failed: not connected and AwaitForConnection is not set.");
|
|
3899
3899
|
const callArgs = args.slice(0, methodDef.argCount);
|
|
3900
3900
|
const outboundCall = peer.call(wireName, callArgs, callOptions);
|
|
3901
|
-
const result = await outboundCall.result
|
|
3901
|
+
const result = await outboundCall.result;
|
|
3902
3902
|
return resolveStreamRefs(result, peer);
|
|
3903
3903
|
};
|
|
3904
3904
|
}
|