@zlink-systems/stream-connector 0.23.0 → 0.24.0

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.
@@ -1827,7 +1827,7 @@ var ZlinkStreamConnectorBundle = (() => {
1827
1827
  if (this.observers.size === 0) {
1828
1828
  return;
1829
1829
  }
1830
- const abandoned = [...this.observers.values()].flatMap((set) => [...set]);
1830
+ const abandoned = Array.from(this.observers.values()).flatMap((set) => Array.from(set));
1831
1831
  this.observers.clear();
1832
1832
  for (const registration of abandoned) {
1833
1833
  registration.onConnectionEnded();
@@ -1836,7 +1836,7 @@ var ZlinkStreamConnectorBundle = (() => {
1836
1836
  enqueue(message, signal) {
1837
1837
  var _a, _b;
1838
1838
  this.receivedCounts.set(message.name, ((_a = this.receivedCounts.get(message.name)) != null ? _a : 0) + 1);
1839
- for (const registration of [...(_b = this.observers.get(message.name)) != null ? _b : []]) {
1839
+ for (const registration of Array.from((_b = this.observers.get(message.name)) != null ? _b : [])) {
1840
1840
  if (registration.consume(message)) {
1841
1841
  return;
1842
1842
  }
@@ -1908,7 +1908,7 @@ var ZlinkStreamConnectorBundle = (() => {
1908
1908
  continue;
1909
1909
  }
1910
1910
  const { message, signal } = queued;
1911
- const handlers = [...this.handlers.get(message.name)];
1911
+ const handlers = Array.from(this.handlers.get(message.name));
1912
1912
  for (const handler of handlers) {
1913
1913
  try {
1914
1914
  await handler(message, signal);
@@ -1998,7 +1998,7 @@ var ZlinkStreamConnectorBundle = (() => {
1998
1998
  async drain(signal) {
1999
1999
  while (this.pendingWrites.size > 0) {
2000
2000
  throwIfAborted(signal);
2001
- await Promise.allSettled([...this.pendingWrites]);
2001
+ await Promise.allSettled(Array.from(this.pendingWrites));
2002
2002
  }
2003
2003
  }
2004
2004
  async write(connection, frame, signal) {
@@ -2083,7 +2083,7 @@ var ZlinkStreamConnectorBundle = (() => {
2083
2083
  __publicField(this, "unboundHandlers", /* @__PURE__ */ new Set());
2084
2084
  }
2085
2085
  get snapshot() {
2086
- return Object.freeze([...this.bySlot.values()]);
2086
+ return Object.freeze(Array.from(this.bySlot.values()));
2087
2087
  }
2088
2088
  find(actorId) {
2089
2089
  return this.byId.get(actorId);
@@ -2171,7 +2171,7 @@ var ZlinkStreamConnectorBundle = (() => {
2171
2171
  }
2172
2172
  queue(handlers, actor, signal) {
2173
2173
  this.receivedMessages.enqueueCallback(() => {
2174
- for (const handler of [...handlers]) {
2174
+ for (const handler of Array.from(handlers)) {
2175
2175
  this.invoke(handler, actor, signal);
2176
2176
  }
2177
2177
  });
@@ -2899,13 +2899,19 @@ var ZlinkStreamConnectorBundle = (() => {
2899
2899
  return subscription(() => this.stateHandlers.delete(handler));
2900
2900
  }
2901
2901
  async publishError(error, signal) {
2902
- await this.publish([...this.errorHandlers].map((handler) => () => handler(error, signal)));
2902
+ await this.publish(
2903
+ Array.from(this.errorHandlers).map((handler) => () => handler(error, signal))
2904
+ );
2903
2905
  }
2904
2906
  async publishDisconnected(signal) {
2905
- await this.publish([...this.disconnectedHandlers].map((handler) => () => handler(signal)));
2907
+ await this.publish(
2908
+ Array.from(this.disconnectedHandlers).map((handler) => () => handler(signal))
2909
+ );
2906
2910
  }
2907
2911
  async publishStateChanged(change, signal) {
2908
- await this.publish([...this.stateHandlers].map((handler) => () => handler(change, signal)));
2912
+ await this.publish(
2913
+ Array.from(this.stateHandlers).map((handler) => () => handler(change, signal))
2914
+ );
2909
2915
  }
2910
2916
  async publish(handlers) {
2911
2917
  await Promise.allSettled(handlers.map(async (handler) => handler()));
@@ -3440,7 +3446,7 @@ var ZlinkStreamConnectorBundle = (() => {
3440
3446
  let pending;
3441
3447
  try {
3442
3448
  throwIfAborted(signal);
3443
- for (const handler of [...this.requestSendingHandlers]) {
3449
+ for (const handler of Array.from(this.requestSendingHandlers)) {
3444
3450
  try {
3445
3451
  handler(sendingContext);
3446
3452
  } catch (cause) {
@@ -3498,7 +3504,7 @@ var ZlinkStreamConnectorBundle = (() => {
3498
3504
  publishReplyReceived(context, signal) {
3499
3505
  if (this.replyReceivedHandlers.size === 0) return;
3500
3506
  this.receivedMessages.enqueueCallback(async () => {
3501
- for (const handler of [...this.replyReceivedHandlers]) {
3507
+ for (const handler of Array.from(this.replyReceivedHandlers)) {
3502
3508
  try {
3503
3509
  await handler(context, signal);
3504
3510
  } catch (cause) {
@@ -1765,7 +1765,7 @@ var ZlinkStreamReceivedMessages = class {
1765
1765
  if (this.observers.size === 0) {
1766
1766
  return;
1767
1767
  }
1768
- const abandoned = [...this.observers.values()].flatMap((set) => [...set]);
1768
+ const abandoned = Array.from(this.observers.values()).flatMap((set) => Array.from(set));
1769
1769
  this.observers.clear();
1770
1770
  for (const registration of abandoned) {
1771
1771
  registration.onConnectionEnded();
@@ -1773,7 +1773,7 @@ var ZlinkStreamReceivedMessages = class {
1773
1773
  }
1774
1774
  enqueue(message, signal) {
1775
1775
  this.receivedCounts.set(message.name, (this.receivedCounts.get(message.name) ?? 0) + 1);
1776
- for (const registration of [...this.observers.get(message.name) ?? []]) {
1776
+ for (const registration of Array.from(this.observers.get(message.name) ?? [])) {
1777
1777
  if (registration.consume(message)) {
1778
1778
  return;
1779
1779
  }
@@ -1845,7 +1845,7 @@ var ZlinkStreamReceivedMessages = class {
1845
1845
  continue;
1846
1846
  }
1847
1847
  const { message, signal } = queued;
1848
- const handlers = [...this.handlers.get(message.name)];
1848
+ const handlers = Array.from(this.handlers.get(message.name));
1849
1849
  for (const handler of handlers) {
1850
1850
  try {
1851
1851
  await handler(message, signal);
@@ -1934,7 +1934,7 @@ var ZlinkStreamFrameSender = class {
1934
1934
  async drain(signal) {
1935
1935
  while (this.pendingWrites.size > 0) {
1936
1936
  throwIfAborted(signal);
1937
- await Promise.allSettled([...this.pendingWrites]);
1937
+ await Promise.allSettled(Array.from(this.pendingWrites));
1938
1938
  }
1939
1939
  }
1940
1940
  async write(connection, frame, signal) {
@@ -2019,7 +2019,7 @@ var ZlinkStreamActors = class {
2019
2019
  boundHandlers = /* @__PURE__ */ new Set();
2020
2020
  unboundHandlers = /* @__PURE__ */ new Set();
2021
2021
  get snapshot() {
2022
- return Object.freeze([...this.bySlot.values()]);
2022
+ return Object.freeze(Array.from(this.bySlot.values()));
2023
2023
  }
2024
2024
  find(actorId) {
2025
2025
  return this.byId.get(actorId);
@@ -2107,7 +2107,7 @@ var ZlinkStreamActors = class {
2107
2107
  }
2108
2108
  queue(handlers, actor, signal) {
2109
2109
  this.receivedMessages.enqueueCallback(() => {
2110
- for (const handler of [...handlers]) {
2110
+ for (const handler of Array.from(handlers)) {
2111
2111
  this.invoke(handler, actor, signal);
2112
2112
  }
2113
2113
  });
@@ -2825,13 +2825,19 @@ var ZlinkStreamConnectorEvents = class {
2825
2825
  return subscription(() => this.stateHandlers.delete(handler));
2826
2826
  }
2827
2827
  async publishError(error, signal) {
2828
- await this.publish([...this.errorHandlers].map((handler) => () => handler(error, signal)));
2828
+ await this.publish(
2829
+ Array.from(this.errorHandlers).map((handler) => () => handler(error, signal))
2830
+ );
2829
2831
  }
2830
2832
  async publishDisconnected(signal) {
2831
- await this.publish([...this.disconnectedHandlers].map((handler) => () => handler(signal)));
2833
+ await this.publish(
2834
+ Array.from(this.disconnectedHandlers).map((handler) => () => handler(signal))
2835
+ );
2832
2836
  }
2833
2837
  async publishStateChanged(change, signal) {
2834
- await this.publish([...this.stateHandlers].map((handler) => () => handler(change, signal)));
2838
+ await this.publish(
2839
+ Array.from(this.stateHandlers).map((handler) => () => handler(change, signal))
2840
+ );
2835
2841
  }
2836
2842
  async publish(handlers) {
2837
2843
  await Promise.allSettled(handlers.map(async (handler) => handler()));
@@ -3364,7 +3370,7 @@ var DefaultZlinkStreamConnector = class {
3364
3370
  let pending;
3365
3371
  try {
3366
3372
  throwIfAborted(signal);
3367
- for (const handler of [...this.requestSendingHandlers]) {
3373
+ for (const handler of Array.from(this.requestSendingHandlers)) {
3368
3374
  try {
3369
3375
  handler(sendingContext);
3370
3376
  } catch (cause) {
@@ -3422,7 +3428,7 @@ var DefaultZlinkStreamConnector = class {
3422
3428
  publishReplyReceived(context, signal) {
3423
3429
  if (this.replyReceivedHandlers.size === 0) return;
3424
3430
  this.receivedMessages.enqueueCallback(async () => {
3425
- for (const handler of [...this.replyReceivedHandlers]) {
3431
+ for (const handler of Array.from(this.replyReceivedHandlers)) {
3426
3432
  try {
3427
3433
  await handler(context, signal);
3428
3434
  } catch (cause) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zlink-systems/stream-connector",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,6 +22,6 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@zlink-systems/stream-wire": "0.23.0"
25
+ "@zlink-systems/stream-wire": "0.24.0"
26
26
  }
27
27
  }