Skip to content

@queuert/redis

const notifyAdapter = await createRedisNotifyAdapter({
provider: RedisNotifyProvider, // You implement this
channelPrefix?: string, // Channel prefix (default: "queuert")
});

Returns Promise<NotifyAdapter>.

RedisNotifyProvider — you implement this. Note the eval method for Lua scripts (thundering herd optimization):

type RedisNotifyProvider = {
publish: (channel: string, message: string) => Promise<void>;
subscribe: (
channel: string,
onMessage: (message: string) => void,
) => Promise<() => Promise<void>>;
eval: (script: string, keys: string[], args: string[]) => Promise<unknown>;
};

Redis requires two separate connections because clients in subscribe mode cannot run other commands.