InvalidationTracker



The invalidation tracker keeps track of tables modified by queries and notifies its subscribed Observers about such modifications.

Observers contain one or more tables and are added to the tracker via subscribe. Once an observer is subscribed, if a database operation changes one of the tables the observer is subscribed to, then such table is considered 'invalidated' and Observer.onInvalidated will be invoked on the observer. If an observer is no longer interested in tracking modifications it can be removed via unsubscribe.

Summary

Nested types

An observer that can listen for changes in the database by subscribing to an InvalidationTracker.

Public functions

Unit

Refresh subscribed observers asynchronously, invoking Observer.onInvalidated on those whose tables have been invalidated.

Cmn
android

Public functions

refreshAsync

fun refreshAsync(): Unit

Refresh subscribed observers asynchronously, invoking Observer.onInvalidated on those whose tables have been invalidated.

This function should be called after any write operation is performed on the database, such that tracked tables and its associated observers are notified if invalidated.