Package me.aartikov.replica.client

Types

Link copied to clipboard
interface ReplicaClient

Creates and manages replicas.

Link copied to clipboard
interface ReplicaClientEvent

Notifies that something happened in ReplicaClient.

Functions

Link copied to clipboard
suspend fun ReplicaClient.cancelAll()

Cancels network requests in all replicas.

Link copied to clipboard
suspend fun ReplicaClient.cancelByTags(predicate: (Set<ReplicaTag>) -> Boolean)

Cancels network requests in replicas with the matching tags.

Link copied to clipboard
suspend fun ReplicaClient.clearAll()

Cancels network requests and clears data in all replicas.

Link copied to clipboard
suspend fun ReplicaClient.clearByTags(predicate: (Set<ReplicaTag>) -> Boolean)

Cancels network requests and clears data in replicas with the matching tags.

Link copied to clipboard
suspend fun ReplicaClient.invalidateAll(mode: InvalidationMode = InvalidationMode.RefreshIfHasObservers)

Makes all replicas stale.

Link copied to clipboard
suspend fun ReplicaClient.invalidateByTags(mode: InvalidationMode = InvalidationMode.RefreshIfHasObservers, predicate: (Set<ReplicaTag>) -> Boolean)

Makes replicas with the matching tags stale.

Link copied to clipboard
fun ReplicaClient(    networkConnectivityProvider: NetworkConnectivityProvider? = null,     timeProvider: TimeProvider = RealTimeProvider(),     coroutineScope: CoroutineScope = DefaultCoroutineScope): ReplicaClient

Creates a replica client. Typically, it should be a singleton.