SwrCachePlusPolicy

fun SwrCachePlusPolicy(coroutineScope: CoroutineScope, mainDispatcher: CoroutineDispatcher = Dispatchers.Main, mutationOptions: MutationOptions = MutationOptions, mutationReceiver: MutationReceiver = MutationReceiver, queryOptions: QueryOptions = QueryOptions, queryReceiver: QueryReceiver = QueryReceiver, queryCache: QueryCache = QueryCache(), subscriptionOptions: SubscriptionOptions = SubscriptionOptions, subscriptionReceiver: SubscriptionReceiver = SubscriptionReceiver, subscriptionCache: SubscriptionCache = SubscriptionCache(), batchSchedulerFactory: BatchSchedulerFactory = BatchSchedulerFactory.default(mainDispatcher), errorRelay: ErrorRelay? = null, memoryPressure: MemoryPressure = MemoryPressure, networkConnectivity: NetworkConnectivity = NetworkConnectivity, networkResumeAfterDelay: Duration = 2.seconds, networkResumeQueriesFilter: ResumeQueriesFilter = ResumeQueriesFilter( predicate = { it.isFailure } ), windowVisibility: WindowVisibility = WindowVisibility, windowResumeQueriesFilter: ResumeQueriesFilter = ResumeQueriesFilter( predicate = { it.isStaled() } )): SwrCachePlusPolicy

Creates a new instance of SwrCachePlusPolicy.

Parameters

coroutineScope

CoroutineScope for coroutines executed on the SwrCachePlus.

mainDispatcher

CoroutineDispatcher for the main thread.

mutationOptions

Default MutationOptions applied to Mutation.

mutationReceiver

Extension receiver for referencing external instances needed when executing mutate.

queryOptions

Default QueryOptions applied to Query.

queryReceiver

Extension receiver for referencing external instances needed when executing fetch.

queryCache

Management of cached data for inactive Query instances.

subscriptionOptions

Default SubscriptionOptions applied to Subscription.

subscriptionReceiver

Extension receiver for referencing external instances needed when executing subscribe.

subscriptionCache

Management of cached data for inactive Subscription instances.

batchSchedulerFactory

Factory for creating a soil.query.core.BatchScheduler.

errorRelay

Relay for error handling.

memoryPressure

Management of memory pressure.

networkConnectivity

Management of network connectivity.

networkResumeAfterDelay

Duration after which the network resumes.

networkResumeQueriesFilter

Filter for resuming queries after a network error.

windowVisibility

Management of window visibility.

windowResumeQueriesFilter

Filter for resuming queries after a window focus.