function RealtimeBackplanePlugin
Since 0.2.0
RealtimeBackplanePlugin(options?: RealtimeBackplanePluginOptions): IPlugin

Creates the RealtimeBackplanePlugin.

Registers a transport under CAPABILITIES.REALTIME_BACKPLANE, which the WebSocket and SSE plugins resolve optionally — so adding this plugin is what turns their in-process rooms and channels into cluster-wide ones, and removing it returns them to in-process behavior with no code change.

Its priority is above normal so the transport is connected before the consumers register and subscribe.

Examples

Example 1

import { RealtimeBackplanePlugin } from '@setu-ts/realtime-backplane-plugin';

app.register(RealtimeBackplanePlugin({
  transport: 'redis',
  url: 'redis://localhost:6379',
}));
app.register(WebSocketPlugin());

Parameters

Transport configuration; defaults to the in-process 'memory' transport

Return Type

IPlugin

The plugin instance

Usage

import { RealtimeBackplanePlugin } from "realtime-backplane-plugin/src/index.ts";