QueryOptions

fun QueryOptions(staleTime: Duration = QueryOptions.staleTime, gcTime: Duration = QueryOptions.gcTime, prefetchWindowTime: Duration = QueryOptions.prefetchWindowTime, pauseDurationAfter: (Throwable) -> Duration?? = QueryOptions.pauseDurationAfter, revalidateOnReconnect: Boolean = QueryOptions.revalidateOnReconnect, revalidateOnFocus: Boolean = QueryOptions.revalidateOnFocus, onError: (ErrorRecord, QueryModel<*>) -> Unit? = QueryOptions.onError, shouldSuppressErrorRelay: (ErrorRecord, QueryModel<*>) -> Boolean? = QueryOptions.shouldSuppressErrorRelay, keepAliveTime: Duration = QueryOptions.keepAliveTime, logger: LoggerFn? = QueryOptions.logger, shouldRetry: (Throwable) -> Boolean = QueryOptions.shouldRetry, retryCount: Int = QueryOptions.retryCount, retryInitialInterval: Duration = QueryOptions.retryInitialInterval, retryMaxInterval: Duration = QueryOptions.retryMaxInterval, retryMultiplier: Double = QueryOptions.retryMultiplier, retryRandomizationFactor: Double = QueryOptions.retryRandomizationFactor, retryRandomizer: Random = QueryOptions.retryRandomizer): QueryOptions

Creates a new QueryOptions with the specified settings.

Parameters

staleTime

The duration after which the returned value of the fetch function block is considered stale.

gcTime

The period during which the Key's return value, if not referenced anywhere, is temporarily cached in memory.

prefetchWindowTime

Maximum window time on prefetch processing.

pauseDurationAfter

Determines whether query processing needs to be paused based on error.

revalidateOnReconnect

Automatically revalidate active Query when the network reconnects.

revalidateOnFocus

Automatically revalidate active Query when the window is refocused.

onError

This callback function will be called if some query encounters an error.

shouldSuppressErrorRelay

Determines whether to suppress error information when relaying it using soil.query.core.ErrorRelay.

keepAliveTime

The duration to keep the actor alive after the last command is executed.

logger

The logger function.

shouldRetry

Determines whether to retry the command when an error occurs.

retryCount

The number of times to retry the command.

retryInitialInterval

The initial interval for exponential backoff.

retryMaxInterval

The maximum interval for exponential backoff.

retryMultiplier

The multiplier for exponential backoff.

retryRandomizationFactor

The randomization factor for exponential backoff.

retryRandomizer

The randomizer for exponential backoff.