WsServerOptions
The WsServerOptions type describes the options that can be passed to the createWsServer function when using its options object form.
{
createPersisterForPath?: (pathId: Id) => PathPersister | [PathPersister, (store: MergeableStore) => void] | Promise<PathPersister> | Promise<[PathPersister, (store: MergeableStore) => void]> | undefined;
authorize?: Authorize;
canWriteCell?: CanWriteCell;
canWriteValue?: CanWriteValue;
onIgnoredError?: (error: any) => void;
requestTimeoutSeconds?: number;
fragmentSize?: number;
maxBufferSize?: number;
}| Type | Description | |
|---|---|---|
createPersisterForPath? | (pathId: Id) => PathPersister | [PathPersister, (store: MergeableStore) => void] | Promise<PathPersister> | Promise<[PathPersister, (store: MergeableStore) => void]> | undefined | The createPersisterForPath property is an optional function that will create a |
authorize? | Authorize | The authorize property is an optional |
canWriteCell? | CanWriteCell | The canWriteCell property is an optional |
canWriteValue? | CanWriteValue | The canWriteValue property is an optional |
onIgnoredError? | (error: any) => void | The onIgnoredError property is an optional handler for the errors that the server would otherwise ignore when trying to sync data. This is suitable for debugging issues in a development environment. |
requestTimeoutSeconds? | number | The requestTimeoutSeconds property is an optional time in seconds that the server will wait for responses to synchronization requests and incomplete fragments, defaulting to |
fragmentSize? | number | The fragmentSize property is an optional target maximum UTF-8 byte size for each WebSocket message fragment sent by the server. |
maxBufferSize? | number | The maxBufferSize property is an optional number of UTF-8 bytes that each WebSocket may hold, defaulting to 16 MiB ( |
Setting any of the authorize, canWriteCell, or canWriteValue options makes each path's MergeableStore the only peer that its clients synchronize with. Clients no longer answer each other directly, so that everything they read and write passes through the server. A path gets an in-memory MergeableStore if the createPersisterForPath option does not provide one.
Since
v10.1.0