@mulingai-npm/redis 3.13.0 → 3.14.0
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.
|
@@ -13,7 +13,7 @@ export declare class MulingstreamListenerManager {
|
|
|
13
13
|
private redisClient;
|
|
14
14
|
constructor(redisClient: RedisClient);
|
|
15
15
|
private parseHashData;
|
|
16
|
-
addListener(listenerData:
|
|
16
|
+
addListener(listenerData: MulingstreamListenerData): Promise<string>;
|
|
17
17
|
getAllListeners(): Promise<MulingstreamListenerData[]>;
|
|
18
18
|
getListenersByRoom(roomId: string): Promise<MulingstreamListenerData[]>;
|
|
19
19
|
getListener(listenerIdOrToken: string): Promise<MulingstreamListenerData | null>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MulingstreamListenerManager = void 0;
|
|
4
|
-
const uuid_1 = require("uuid");
|
|
5
4
|
const EXPIRATION = 24 * 60 * 60; // 24 hours in seconds
|
|
6
5
|
class MulingstreamListenerManager {
|
|
7
6
|
constructor(redisClient) {
|
|
@@ -25,7 +24,7 @@ class MulingstreamListenerManager {
|
|
|
25
24
|
async addListener(listenerData) {
|
|
26
25
|
var _a, _b, _c;
|
|
27
26
|
// You can combine roomId + uuid, or just a uuid, up to you:
|
|
28
|
-
const listenerId =
|
|
27
|
+
const listenerId = listenerData.listenerId;
|
|
29
28
|
// Add listenerId to the set for that room
|
|
30
29
|
await this.redisClient.sadd(`room:${listenerData.roomId}:listeners`, listenerId);
|
|
31
30
|
// Store listener data in a hash
|