@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.js CHANGED
@@ -471,7 +471,7 @@ var RpcWebSocketConnection = class {
471
471
  return this._ws.readyState === WebSocketState.OPEN;
472
472
  }
473
473
  get whenConnected() {
474
- return this._connected.promise;
474
+ return this._connected;
475
475
  }
476
476
  send(serializedMessage) {
477
477
  this._sendRaw(serializedMessage);
@@ -1043,7 +1043,7 @@ var RpcStreamSender = class _RpcStreamSender {
1043
1043
  * src/ActualLab.Rpc/Infrastructure/RpcSharedStream.cs.
1044
1044
  */
1045
1045
  async writeFrom(source) {
1046
- await this._started.promise;
1046
+ await this._started;
1047
1047
  if (this._ended) return;
1048
1048
  const iterator = source[Symbol.asyncIterator]();
1049
1049
  this._iterator = iterator;
@@ -1242,7 +1242,7 @@ var RpcStreamSender = class _RpcStreamSender {
1242
1242
  async _waitAckReady() {
1243
1243
  if (this._acks.length > 0 || this._ended) return;
1244
1244
  this._whenAckReady = new PromiseSource3();
1245
- await this._whenAckReady.promise;
1245
+ await this._whenAckReady;
1246
1246
  this._whenAckReady = null;
1247
1247
  }
1248
1248
  // -- IRpcObject --
@@ -1564,7 +1564,7 @@ var RpcStream = class _RpcStream {
1564
1564
  return { value: void 0, done: true };
1565
1565
  }
1566
1566
  this._consumerWaiting = new PromiseSource4();
1567
- await this._consumerWaiting.promise;
1567
+ await this._consumerWaiting;
1568
1568
  }
1569
1569
  },
1570
1570
  return: () => {
@@ -2348,7 +2348,7 @@ var RpcPeer = class {
2348
2348
  this._sendWireData(outboundCall.serializedWireData);
2349
2349
  };
2350
2350
  this.connectionStateChanged.add(stateHandler);
2351
- outboundCall.result.promise.then(() => this.connectionStateChanged.remove(stateHandler)).catch(() => this.connectionStateChanged.remove(stateHandler));
2351
+ outboundCall.result.then(() => this.connectionStateChanged.remove(stateHandler)).catch(() => this.connectionStateChanged.remove(stateHandler));
2352
2352
  }
2353
2353
  const signal = options?.signal;
2354
2354
  if (signal !== void 0) {
@@ -2361,7 +2361,7 @@ var RpcPeer = class {
2361
2361
  }
2362
2362
  };
2363
2363
  signal.addEventListener("abort", onAbort, { once: true });
2364
- outboundCall.result.promise.then(() => signal.removeEventListener("abort", onAbort)).catch(() => signal.removeEventListener("abort", onAbort));
2364
+ outboundCall.result.then(() => signal.removeEventListener("abort", onAbort)).catch(() => signal.removeEventListener("abort", onAbort));
2365
2365
  }
2366
2366
  return outboundCall;
2367
2367
  }
@@ -2683,7 +2683,7 @@ var RpcClientPeer = class extends RpcPeer {
2683
2683
  whenClosed.resolve(ev);
2684
2684
  closedController.abort();
2685
2685
  });
2686
- const closedRejection = whenClosed.promise.then(() => {
2686
+ const closedRejection = whenClosed.then(() => {
2687
2687
  throw new Error("Connection failed");
2688
2688
  });
2689
2689
  closedRejection.catch(() => {
@@ -2721,7 +2721,7 @@ var RpcClientPeer = class extends RpcPeer {
2721
2721
  let remoteHandshake;
2722
2722
  try {
2723
2723
  remoteHandshake = await withTimeout(
2724
- Promise.race([this._pendingHandshake.promise, closedRejection]),
2724
+ Promise.race([this._pendingHandshake, closedRejection]),
2725
2725
  handshakeTimeoutMs,
2726
2726
  "Handshake timeout"
2727
2727
  );
@@ -2750,7 +2750,7 @@ var RpcClientPeer = class extends RpcPeer {
2750
2750
  this._setConnectionState(3 /* Connected */);
2751
2751
  this._tryIndex = 0;
2752
2752
  await this._reconnect(isPeerChanged, closedController.signal);
2753
- await whenClosed.promise;
2753
+ await whenClosed;
2754
2754
  } catch (e) {
2755
2755
  debugLog2?.log(`'${this.ref}': run() iteration failed:`, e);
2756
2756
  }
@@ -2890,7 +2890,7 @@ var RpcClientPeer = class extends RpcPeer {
2890
2890
  signal: closedSignal
2891
2891
  }
2892
2892
  );
2893
- const result = await reconnectCall.result.promise;
2893
+ const result = await reconnectCall.result;
2894
2894
  const bytes = _toBytes2(result);
2895
2895
  if (bytes === null) return new Set(eligible.map((c) => c.callId));
2896
2896
  return new Set(IncreasingSeqCompressor.deserialize(bytes));
@@ -3775,7 +3775,7 @@ var RpcHub = class {
3775
3775
  throw new Error("Outbound call failed: not connected and AwaitForConnection is not set.");
3776
3776
  const callArgs = args.slice(0, methodDef.argCount);
3777
3777
  const outboundCall = peer.call(wireName, callArgs);
3778
- const result = await outboundCall.result.promise;
3778
+ const result = await outboundCall.result;
3779
3779
  const ref = parseStreamRef(result);
3780
3780
  if (!ref)
3781
3781
  throw new Error(
@@ -3792,7 +3792,7 @@ var RpcHub = class {
3792
3792
  throw new Error("Outbound call failed: not connected and AwaitForConnection is not set.");
3793
3793
  const callArgs = args.slice(0, methodDef.argCount);
3794
3794
  const outboundCall = peer.call(wireName, callArgs, callOptions);
3795
- const result = await outboundCall.result.promise;
3795
+ const result = await outboundCall.result;
3796
3796
  return resolveStreamRefs(result, peer);
3797
3797
  };
3798
3798
  }