Saltar al contenido
Meeko
Escribe para buscar en las guías y en la referencia de la API. Ábrela desde cualquier página con / o Ctrl K; muévete con las flechas y entra con Intro.
Empezar

Contenidos

En esta página

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 #

método

publish(channel: string, message: string): Promise<unknown>

PUBLISH de un mensaje en un canal.

sPublish #

método opcional

sPublish?(channel: string, message: string): Promise<unknown>

Pub/sub fragmentado de Redis 7 (SPUBLISH); sólo hace falta con sharded: true.

¿Te sirvió esta página?

Añadir un comentario

Se envía al elegir «Sí» o «No». Solo se guardan la página, tu respuesta y el comentario: ni cookies ni datos tuyos.

0 de 2000 caracteres

Editar en GitHub: packages/meeko/src/server/runtime/redis-pubsub.ts