MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / psubscribeToPublishedEvent

Function psubscribeToPublishedEvent

packages/redis/publisher.ts:72–85  ·  view source on GitHub ↗
(
  pattern: string,
  callback: (key: string) => void,
)

Source from the content-addressed store, hash-verified

70}
71
72export function psubscribeToPublishedEvent(
73 pattern: string,
74 callback: (key: string) => void,
75) {
76 getRedisSub().psubscribe(pattern);
77 const pmessage = (_: unknown, pattern: string, key: string) => callback(key);
78
79 getRedisSub().on('pmessage', pmessage);
80
81 return () => {
82 getRedisSub().punsubscribe(pattern);
83 getRedisSub().off('pmessage', pmessage);
84 };
85}

Callers

nothing calls this directly

Calls 1

getRedisSubFunction · 0.90

Tested by

no test coverage detected