@nats-io/nats-core
Advanced tools
Comparing version 3.0.0-24 to 3.0.0-25
@@ -36,3 +36,3 @@ export { NatsConnectionImpl } from "./nats"; | ||
export { extractProtocolMessage, protoLen } from "./transport"; | ||
export type { ApiError, Auth, Authenticator, ConnectionOptions, Dispatcher, JwtAuth, Msg, MsgCallback, MsgHdrs, Nanos, NatsConnection, NKeyAuth, NoAuth, Payload, Publisher, PublishOptions, QueuedIterator, Request, RequestManyOptions, RequestOptions, ReviverFn, Server, ServerInfo, ServersChanged, Stats, Status, Sub, SubOpts, Subscription, SubscriptionOptions, SyncIterator, TlsOptions, TokenAuth, UserPass, } from "./core"; | ||
export type { ApiError, Auth, Authenticator, CallbackFn, ConnectionOptions, Dispatcher, JwtAuth, Msg, MsgCallback, MsgHdrs, Nanos, NatsConnection, NKeyAuth, NoAuth, Payload, Publisher, PublishOptions, QueuedIterator, Request, RequestManyOptions, RequestOptions, ReviverFn, Server, ServerInfo, ServersChanged, Stats, Status, Sub, SubOpts, Subscription, SubscriptionOptions, SyncIterator, TlsOptions, TokenAuth, UserPass, } from "./core"; | ||
export { createInbox, DebugEvents, ErrorCode, Events, isNatsError, Match, NatsError, RequestStrategy, syncIterator, } from "./core"; | ||
@@ -39,0 +39,0 @@ export { SubscriptionImpl, Subscriptions } from "./protocol"; |
@@ -53,2 +53,3 @@ import type { Deferred } from "./util"; | ||
yielding: boolean; | ||
didBreak: boolean; | ||
constructor(); | ||
@@ -55,0 +56,0 @@ [Symbol.asyncIterator](): AsyncIterator<T>; |
@@ -26,2 +26,3 @@ "use strict"; | ||
yielding; | ||
didBreak; | ||
constructor() { | ||
@@ -40,2 +41,3 @@ this.inflight = 0; | ||
this.yielding = false; | ||
this.didBreak = false; | ||
} | ||
@@ -49,2 +51,17 @@ [Symbol.asyncIterator]() { | ||
} | ||
// if they `break` from a `for await`, any signaling that is pushed via | ||
// a function is not handled this can prevent closed promises from | ||
// resolving downstream. | ||
if (this.didBreak) { | ||
if (typeof v === "function") { | ||
const cb = v; | ||
try { | ||
cb(); | ||
} | ||
catch (_) { | ||
// ignored | ||
} | ||
} | ||
return; | ||
} | ||
if (typeof v === "function") { | ||
@@ -136,2 +153,3 @@ this.yields.push(v); | ||
// the iterator used break/return | ||
this.didBreak = true; | ||
this.stop(); | ||
@@ -138,0 +156,0 @@ } |
@@ -1,1 +0,1 @@ | ||
export declare const version = "3.0.0-24"; | ||
export declare const version = "3.0.0-25"; |
@@ -5,3 +5,3 @@ "use strict"; | ||
// This file is generated - do not edit | ||
exports.version = "3.0.0-24"; | ||
exports.version = "3.0.0-25"; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@nats-io/nats-core", | ||
"version": "3.0.0-24", | ||
"version": "3.0.0-25", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "lib/", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
549594
8644