RedisPublisherClient
interfaz
Lado publicador de un cliente Redis, compatible por estructura con node-redis 4 o posterior.
ts
import type { RedisPublisherClient } from "@meekojs/meeko/server";Código fuente src/server/runtime/redis-pubsub.ts:30
Declaración #
ts
interface RedisPublisherClient {
publish(channel: string, message: string): Promise<unknown>
sPublish?(channel: string, message: string): Promise<unknown>
}Ejemplo #
ts
import { createClient } from "redis";
import type { RedisPublisherClient } from "@meekojs/meeko/server";
const publisher: RedisPublisherClient = createClient({ url: process.env.MEEKO_REDIS_URL });Miembros #
publish
#
publish(channel: string, message: string): Promise<unknown>PUBLISH de un mensaje en un canal.
sPublish
#
sPublish?(channel: string, message: string): Promise<unknown>Pub/sub fragmentado de Redis 7 (SPUBLISH); sólo hace falta con sharded: true.