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 }
), networkResumeSubscriptionsFilter: ResumeSubscriptionsFilter = ResumeSubscriptionsFilter(
predicate = { it.isFailure }
), windowVisibility: WindowVisibility = WindowVisibility, windowResumeQueriesFilter: ResumeQueriesFilter = ResumeQueriesFilter(
predicate = { it.isStaled() }
), windowResumeSubscriptionsFilter: ResumeSubscriptionsFilter = ResumeSubscriptionsFilter(
predicate = { it.isFailure }
)): SwrCachePlusPolicy Creates a new instance of SwrCachePlusPolicy.
Parameters
CoroutineDispatcher for the main thread.
Extension receiver for referencing external instances needed when executing mutate.
Extension receiver for referencing external instances needed when executing fetch.
Management of cached data for inactive Query instances.
Extension receiver for referencing external instances needed when executing subscribe.
Management of cached data for inactive Subscription instances.
Relay for error handling.
Management of memory pressure.
Management of network connectivity.
Duration after which the network resumes.
networkResumeQueriesFilter
Filter for resuming queries after a network error.
networkResumeSubscriptionsFilter
Filter for resuming subscriptions after a network error.
Management of window visibility.
windowResumeQueriesFilter
Filter for resuming queries after a window focus.
windowResumeSubscriptionsFilter
Filter for resuming subscriptions after a window focus.
fun SwrCachePlusPolicy(coroutineScope: CoroutineScope, mainDispatcher: CoroutineDispatcher = Dispatchers.Main, mutationOptions: MutationOptions = MutationOptions, queryOptions: QueryOptions = QueryOptions, queryCache: QueryCache = QueryCache(), subscriptionOptions: SubscriptionOptions = SubscriptionOptions, 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 }
), networkResumeSubscriptionsFilter: ResumeSubscriptionsFilter = ResumeSubscriptionsFilter(
predicate = { it.isFailure }
), windowVisibility: WindowVisibility = WindowVisibility, windowResumeQueriesFilter: ResumeQueriesFilter = ResumeQueriesFilter(
predicate = { it.isStaled() }
), windowResumeSubscriptionsFilter: ResumeSubscriptionsFilter = ResumeSubscriptionsFilter(
predicate = { it.isFailure }
), receiverBuilder: SwrReceiverBuilderPlus.() -> Unit): SwrCachePlusPolicy Create a new SwrCachePlusPolicy instance with a receiver builder.
Parameters
CoroutineDispatcher for the main thread.
Management of cached data for inactive Query instances.
Management of cached data for inactive Subscription instances.
Relay for error handling.
Management of memory pressure.
Management of network connectivity.
Duration after which the network resumes.
networkResumeQueriesFilter
Filter for resuming queries after a network error.
networkResumeSubscriptionsFilter
Filter for resuming subscriptions after a network error.
Management of window visibility.
windowResumeQueriesFilter
Filter for resuming queries after a window focus.
windowResumeSubscriptionsFilter
Filter for resuming subscriptions after a window focus.