@rotorsoft/act 1.33.3 → 1.33.4
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/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/internal/correlate-cycle.d.ts.map +1 -1
- package/dist/@types/internal/drain-cycle.d.ts.map +1 -1
- package/dist/index.cjs +7 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1370,13 +1370,14 @@ var CorrelateCycle = class {
|
|
|
1370
1370
|
});
|
|
1371
1371
|
}
|
|
1372
1372
|
if (streams.length) {
|
|
1373
|
+
const held = lease && this._lease_until > 0;
|
|
1373
1374
|
const renewed_at = Date.now();
|
|
1374
1375
|
const { subscribed, correlating } = await this._cd.subscribe(
|
|
1375
1376
|
streams,
|
|
1376
1377
|
last_id,
|
|
1377
|
-
|
|
1378
|
+
held ? { key: this._key, by: this._by, millis: CORRELATION_LEASE_MS } : void 0
|
|
1378
1379
|
);
|
|
1379
|
-
if (
|
|
1380
|
+
if (held && correlating !== false)
|
|
1380
1381
|
this._lease_until = renewed_at + CORRELATION_LEASE_MS;
|
|
1381
1382
|
const marked = streams.filter(
|
|
1382
1383
|
(entry) => entry.correlated_at !== void 0
|
|
@@ -2365,7 +2366,7 @@ var DrainController = class {
|
|
|
2365
2366
|
_defer = new DeferTimer(() => {
|
|
2366
2367
|
this._armed = true;
|
|
2367
2368
|
void this._deps.run_scoped(async () => {
|
|
2368
|
-
while (
|
|
2369
|
+
while ((await this.drain()).leased.length > 0) ;
|
|
2369
2370
|
});
|
|
2370
2371
|
});
|
|
2371
2372
|
_worker;
|
|
@@ -2421,7 +2422,7 @@ var DrainController = class {
|
|
|
2421
2422
|
this._defer.stop();
|
|
2422
2423
|
}
|
|
2423
2424
|
async drain(options = {}) {
|
|
2424
|
-
if (!this._armed) return EMPTY_DRAIN;
|
|
2425
|
+
if (!this._armed || this._stopped) return EMPTY_DRAIN;
|
|
2425
2426
|
if (this._locked) return EMPTY_DRAIN;
|
|
2426
2427
|
const d = this._deps.defaults ?? {};
|
|
2427
2428
|
const streamLimit = d.streamLimit ?? options.streamLimit ?? DEFAULT_STREAM_LIMIT;
|
|
@@ -3198,11 +3199,11 @@ var Act = class {
|
|
|
3198
3199
|
resolveShutdownConfig(options);
|
|
3199
3200
|
this._shutdown_promise = (async () => {
|
|
3200
3201
|
this.stop_correlations();
|
|
3201
|
-
const disposer = await this._notify_disposer;
|
|
3202
|
-
if (disposer) await disposer();
|
|
3203
3202
|
this._settle.stop(true);
|
|
3204
3203
|
this._breaker.stop();
|
|
3205
3204
|
for (const c of this._drain_controllers.values()) c.stop();
|
|
3205
|
+
const disposer = await this._notify_disposer;
|
|
3206
|
+
if (disposer) await disposer();
|
|
3206
3207
|
await this._await_inflight(options?.graceMs);
|
|
3207
3208
|
await this._scoped(() => this._correlate.release_correlation());
|
|
3208
3209
|
this._emitter.removeAllListeners();
|