@mulingai-npm/redis 3.21.0 → 3.22.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.
|
@@ -189,5 +189,18 @@ class MulingstreamListenerManager {
|
|
|
189
189
|
languageBreakdown
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
+
async getListenerBySocketId(socketId) {
|
|
193
|
+
const keys = await this.redisClient.keys('listener:*');
|
|
194
|
+
if (!keys || keys.length === 0) {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
for (const key of keys) {
|
|
198
|
+
const data = await this.redisClient.hgetall(key);
|
|
199
|
+
if (data && data.socketId === socketId) {
|
|
200
|
+
return this.parseHashData(data);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
192
205
|
}
|
|
193
206
|
exports.MulingstreamListenerManager = MulingstreamListenerManager;
|