Skip to main content
zerotal

Documentation


Documentation / @zerotal/flow / index / setSharedStore

Function: setSharedStore()

setSharedStore(store): void

Defined in: flow/src/shared.ts:76

Replace the process-wide backing store for @shared room state. Call this once at boot to move convergence off the default in-process map onto a distributed backend so it fans out across server instances.

Parameters

store

SharedStore

The store implementation to install.

Returns

void

Example

// boot: converge @shared state across all app instances via Redis.
setSharedStore(new RedisSharedStore(redis));