Package me.aartikov.replica.common
Types
Link copied to clipboard
Represent several errors (one or more) occurred during a network request.
Link copied to clipboard
Specifies how a replica behaves after invalidation.
Link copied to clipboard
Represent an error occurred during a network request.
Link copied to clipboard
data class ObservingState( val observerIds: Set<Long> = emptySet(), val activeObserverIds: Set<Long> = emptySet(), val observingTime: ObservingTime = ObservingTime.Never)
Content copied to clipboard
Has information about observers of a replica.
Link copied to clipboard
Link copied to clipboard
Represent information when a replica was observed in last time.
Link copied to clipboard
Action executed for optimistic update
Link copied to clipboard
Can be used to perform bulk operations on a subset of replicas. See: cancelByTags, clearByTags, invalidateByTags.
Functions
Link copied to clipboard
inline suspend fun <R> performOptimisticUpdate( begin: () -> Unit, commit: () -> Unit, crossinline rollback: suspend () -> Unit, noinline onSuccess: suspend () -> Unit? = null, noinline onError: suspend (Exception) -> Unit? = null, noinline onCanceled: suspend () -> Unit? = null, noinline onFinished: suspend () -> Unit? = null, block: () -> R): R
Content copied to clipboard
Executes begin and then block. If an operation succeed than commit is executed, otherwise rollback is executed. onSuccess, onError, onCanceled, onFinished are optional callbacks for additional actions.