minerender 2.1.0-alpha.6 → 2.1.0-alpha.7

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.
@@ -534,14 +534,13 @@ declare class MinecraftFaceUV {
534
534
  }
535
535
 
536
536
  /**
537
- * Releases every long-lived timer MineRender holds, so a Node process can exit.
537
+ * Stops the shared Ticker and request queues, and clears the in-memory caches.
538
538
  *
539
- * Both `@inventivetalent/loading-cache` (cache expiry) and `jobqu` (request queue draining) use
540
- * self-rescheduling timers that are not unref'd, which keeps the event loop alive for as long as
541
- * the library is loaded. Browsers don't care, but anything headless - a render server, a CLI, a
542
- * test run - has to call this when it's done.
539
+ * Idle Node processes can exit without calling this: cache and Ticker timers are unref'd,
540
+ * and idle request queues hold no timer. Pending requests keep their normal timer references.
543
541
  *
544
- * The library stays usable afterwards; the caches and queues simply start over.
542
+ * Call this only when finished with MineRender. Waiting and future requests reject; requests
543
+ * already running can finish. Queue shutdown is permanent, and cache expiry timers do not restart.
545
544
  */
546
545
  declare function shutdown(): void;
547
546
 
@@ -1219,8 +1218,8 @@ declare class Caching {
1219
1218
  /**
1220
1219
  * Clears every cache and stops its expiry timer.
1221
1220
  *
1222
- * loading-cache reschedules that timer indefinitely, so a Node process will not exit until
1223
- * this is called - see {@link shutdown}.
1221
+ * Expiry timers are unref'd in Node, so idle processes can exit without this cleanup.
1222
+ * Use {@link shutdown} to also stop requests and the shared Ticker.
1224
1223
  */
1225
1224
  static end(): void;
1226
1225
  static get cacheSizes(): {};
@@ -1473,8 +1472,9 @@ declare class Requests {
1473
1472
  mcAsset: number;
1474
1473
  };
1475
1474
  /**
1476
- * Stops both queue timers. jobqu reschedules itself indefinitely, so a Node process will not
1477
- * exit until this is called - see {@link shutdown}.
1475
+ * Permanently stops both queues and rejects waiting and future requests.
1476
+ * Requests already running can finish. Idle queues hold no timer, so Node can exit without
1477
+ * this cleanup. See {@link shutdown}.
1478
1478
  */
1479
1479
  static end(): void;
1480
1480
  }
@@ -534,14 +534,13 @@ declare class MinecraftFaceUV {
534
534
  }
535
535
 
536
536
  /**
537
- * Releases every long-lived timer MineRender holds, so a Node process can exit.
537
+ * Stops the shared Ticker and request queues, and clears the in-memory caches.
538
538
  *
539
- * Both `@inventivetalent/loading-cache` (cache expiry) and `jobqu` (request queue draining) use
540
- * self-rescheduling timers that are not unref'd, which keeps the event loop alive for as long as
541
- * the library is loaded. Browsers don't care, but anything headless - a render server, a CLI, a
542
- * test run - has to call this when it's done.
539
+ * Idle Node processes can exit without calling this: cache and Ticker timers are unref'd,
540
+ * and idle request queues hold no timer. Pending requests keep their normal timer references.
543
541
  *
544
- * The library stays usable afterwards; the caches and queues simply start over.
542
+ * Call this only when finished with MineRender. Waiting and future requests reject; requests
543
+ * already running can finish. Queue shutdown is permanent, and cache expiry timers do not restart.
545
544
  */
546
545
  declare function shutdown(): void;
547
546
 
@@ -1219,8 +1218,8 @@ declare class Caching {
1219
1218
  /**
1220
1219
  * Clears every cache and stops its expiry timer.
1221
1220
  *
1222
- * loading-cache reschedules that timer indefinitely, so a Node process will not exit until
1223
- * this is called - see {@link shutdown}.
1221
+ * Expiry timers are unref'd in Node, so idle processes can exit without this cleanup.
1222
+ * Use {@link shutdown} to also stop requests and the shared Ticker.
1224
1223
  */
1225
1224
  static end(): void;
1226
1225
  static get cacheSizes(): {};
@@ -1473,8 +1472,9 @@ declare class Requests {
1473
1472
  mcAsset: number;
1474
1473
  };
1475
1474
  /**
1476
- * Stops both queue timers. jobqu reschedules itself indefinitely, so a Node process will not
1477
- * exit until this is called - see {@link shutdown}.
1475
+ * Permanently stops both queues and rejects waiting and future requests.
1476
+ * Requests already running can finish. Idle queues hold no timer, so Node can exit without
1477
+ * this cleanup. See {@link shutdown}.
1478
1478
  */
1479
1479
  static end(): void;
1480
1480
  }
@@ -576,8 +576,8 @@ var Caching = class {
576
576
  /**
577
577
  * Clears every cache and stops its expiry timer.
578
578
  *
579
- * loading-cache reschedules that timer indefinitely, so a Node process will not exit until
580
- * this is called - see {@link shutdown}.
579
+ * Expiry timers are unref'd in Node, so idle processes can exit without this cleanup.
580
+ * Use {@link shutdown} to also stop requests and the shared Ticker.
581
581
  */
582
582
  static end() {
583
583
  for (const cache of this.all) {
@@ -825,13 +825,14 @@ var _Requests = class _Requests {
825
825
  }
826
826
  static get queueSizes() {
827
827
  return {
828
- generic: this.genericQueue.size,
829
- mcAsset: this.mcAssetRequestQueue.size
828
+ generic: this.genericQueue.size + this.genericQueue.activeSize,
829
+ mcAsset: this.mcAssetRequestQueue.size + this.mcAssetRequestQueue.activeSize
830
830
  };
831
831
  }
832
832
  /**
833
- * Stops both queue timers. jobqu reschedules itself indefinitely, so a Node process will not
834
- * exit until this is called - see {@link shutdown}.
833
+ * Permanently stops both queues and rejects waiting and future requests.
834
+ * Requests already running can finish. Idle queues hold no timer, so Node can exit without
835
+ * this cleanup. See {@link shutdown}.
835
836
  */
836
837
  static end() {
837
838
  this.genericQueue.end();