waitUntilReady

suspend fun waitUntilReady(timeout: Duration, services: Set<ServiceType> = emptySet(), desiredState: ClusterState = ClusterState.ONLINE): Cluster

Waits until SDK bootstrap is complete and the desired ClusterState is observed.

Calling this method is optional. Without it, operations performed before the cluster is ready may take longer than usual, since the SDK bootstrap needs to complete first.

Parameters

timeout

the maximum time to wait for readiness.

services

the service types to wait for, or empty set to wait for all services.

Throws

com.couchbase.client.core.error.UnambiguousTimeoutException

if not ready before timeout