@mulingai-npm/redis 3.40.37 → 3.40.39

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.
@@ -44,6 +44,14 @@ export declare class MulingstreamListenerManager {
44
44
  * No-ops on a non-positive cap so a misconfigured plan never blocks everyone.
45
45
  */
46
46
  setRoomListenerCap(roomId: string, cap: number, ttlSeconds: number): Promise<void>;
47
+ /**
48
+ * Remove a room's cached listener cap. Called by the speaker service on exit
49
+ * (graceful, network disconnect, or force disconnect) so the room reverts to
50
+ * the generous uncached fallback the moment no speaker is present — the cap is
51
+ * re-cached on the next speaker (re)join. Without this the cap key would linger
52
+ * for its full TTL (12h), leaving an empty, speaker-less room wrongly "full".
53
+ */
54
+ clearRoomListenerCap(roomId: string): Promise<void>;
47
55
  /**
48
56
  * Read the cached listener cap for a room. Returns null when no cap has been
49
57
  * cached yet (e.g. the speaker isn't live), so the caller can apply its own
@@ -262,6 +262,16 @@ class MulingstreamListenerManager {
262
262
  await this.redisClient.set(this.capKey(roomId), Math.floor(cap).toString());
263
263
  await this.redisClient.expire(this.capKey(roomId), ttlSeconds);
264
264
  }
265
+ /**
266
+ * Remove a room's cached listener cap. Called by the speaker service on exit
267
+ * (graceful, network disconnect, or force disconnect) so the room reverts to
268
+ * the generous uncached fallback the moment no speaker is present — the cap is
269
+ * re-cached on the next speaker (re)join. Without this the cap key would linger
270
+ * for its full TTL (12h), leaving an empty, speaker-less room wrongly "full".
271
+ */
272
+ async clearRoomListenerCap(roomId) {
273
+ await this.redisClient.del(this.capKey(roomId));
274
+ }
265
275
  /**
266
276
  * Read the cached listener cap for a room. Returns null when no cap has been
267
277
  * cached yet (e.g. the speaker isn't live), so the caller can apply its own
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulingai-npm/redis",
3
- "version": "3.40.37",
3
+ "version": "3.40.39",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {