Options
User-settable options used when defining Client.
Constructors
Properties
channelHeartbeatInterval is the interval of the channel heartbeat. The client sends a heartbeat to the server to refresh the channel TTL. Applies to both Realtime and Manual/Polling channels. The default value is 5000(ms) — TTL/3 for the server's 15s ChannelSessionTTL. Mirrors JS SDK v0.7.10.
Backing store for offline local persistence. When set, attachDocument resumes a previously Document.toBytes-persisted envelope before contacting the server, and the document is persisted again on every local change, local presence change, and successful sync. Unset (the default) disables persistence entirely — no load, no lease, no writes.
documentPollInterval is the push-pull interval for documents attached with SyncMode.Polling. Unused in other sync modes. The default value is 3000(ms). Mirrors JS SDK PR #1243.
fetchAuthToken provides a token for the auth webhook. When the webhook response status code is 401, this function is called to refresh the token. The reason parameter is the reason from the webhook response.
Delay of the reconnect stream. If the stream is disconnected, the client waits for the delay to reconnect the stream. The default value is 1000(ms).
Single-active-session guard used when docStore is set, to prevent two sessions from concurrently resuming the same persisted document under the same stable actor (which would mint colliding clientSeq values and silently lose edits). Defaults to NoopSessionLock: unlike a browser with multiple tabs, an Android app is one process per store by default, so the hazard this guards against is reachable only when docStore is itself shared across processes. Ignored when docStore is unset. Ported from JS client.ts's sessionLock option; JS's browser-only deactivateOnUnload auto-default has no Android analog (no page-unload event) and is not ported.
Duration of the sync loop. After each sync loop, the client waits for the duration to next sync. The default value is 50(ms).
watchFallbackDelay is how long a realtime document's watch stream may stay silent (no frame of any kind received) before that attachment starts pulling on every sync-loop tick (throttled to documentPollInterval) as if it were Polling — i.e. degrades toward polling semantics per-attachment until a watch frame arrives again. This bounds staleness instead of the permanent pull starvation a silently-dead watch stream otherwise causes (a dead watch stream never flips changeEventReceived, so pull would never re-engage on its own — see #351).
watchHeartbeatInterval is the interval at which the client asks the server to send a heartbeat on an idle Watch stream, so that a half-open stream is noticed and reconnected (watchIdleTimeoutMs, c69e6bda/#1472). It is a request, not a setting: the server clamps it to its own bounds and the client times a silent stream out at three times the interval the server actually settles on and advertises back on the init frame. A non-positive value asks for no heartbeats, which also leaves the stream without an idle timeout. The default value is 20000(ms).