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