Options
data class Options(val key: String = UUID.randomUUID().toString(), val apiKey: String? = null, val metadata: Map<String, String> = emptyMap(), val fetchAuthToken: suspend (shouldRefresh: Boolean) -> String? = null, val syncLoopDuration: Duration = 50.milliseconds, val reconnectStreamDelay: Duration = 1_000.milliseconds, val presenceHeartbeatInterval: Duration = 30_000.milliseconds)
User-settable options used when defining Client.
Constructors
Link copied to clipboard
constructor(key: String = UUID.randomUUID().toString(), apiKey: String? = null, metadata: Map<String, String> = emptyMap(), fetchAuthToken: suspend (shouldRefresh: Boolean) -> String? = null, syncLoopDuration: Duration = 50.milliseconds, reconnectStreamDelay: Duration = 1_000.milliseconds, presenceHeartbeatInterval: Duration = 30_000.milliseconds)
Properties
Link copied to clipboard
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.
Link copied to clipboard
presenceHeartbeatInterval is the interval of the presence heartbeat. The client sends a heartbeat to the server to refresh the presence TTL. The default value is 30000(ms).
Link copied to clipboard
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).
Link copied to clipboard
Duration of the sync loop. After each sync loop, the client waits for the duration to next sync. The default value is 50(ms).