Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

RedisSocketPubSubOptions

interfaz

Opciones de RedisSocketPubSub.

ts
import type { RedisSocketPubSubOptions } from "@meekojs/meeko/server";

Source code src/server/runtime/redis-pubsub.ts:125

Declaración #

ts
interface RedisSocketPubSubOptions {
	readonly publisher: RedisPublisherClient
	readonly subscriber: RedisSubscriberClient
	readonly prefix: string
	readonly maxMessageBytes?: number
	readonly sharded?: boolean
	readonly onError?: (error: unknown, context: { readonly channel: string; readonly room: string }) => void
}

Example #

ts
import type { RedisSocketPubSubOptions } from "@meekojs/meeko/server";

const options: RedisSocketPubSubOptions = { publisher: redis, subscriber, prefix: "app:prod:", sharded: true };

Propiedades #

publisher #

propiedad sólo lectura

readonly publisher: RedisPublisherClient

Conexión normal que se usa para PUBLISH.

subscriber #

propiedad sólo lectura

readonly subscriber: RedisSubscriberClient

Conexión dedicada en modo suscriptor.

prefix #

propiedad sólo lectura

readonly prefix: string

Prefijo único por aplicación y entorno; termina en :.

maxMessageBytes #

propiedad sólo lectura opcional

readonly maxMessageBytes?: number

Mensaje serializado más grande que acepta publish. Por defecto, 1 MiB.

sharded #

propiedad sólo lectura opcional

readonly sharded?: boolean

Usa el pub/sub fragmentado de Redis 7 (SPUBLISH/SSUBSCRIBE), recomendado en Redis Cluster.

onError #

propiedad sólo lectura opcional

readonly onError?: (error: unknown, context: { readonly channel: string; readonly room: string }) => void

Recibe los mensajes mal formados y los fallos de los listeners; por defecto, console.error.

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/server/runtime/redis-pubsub.ts