InvalidationTracker.Observer

abstract class InvalidationTracker.Observer


An observer that can listen for changes in the database.

Summary

Public constructors

Observer(tables: Array<String>)

Protected constructors

Observer(firstTable: String, vararg rest: String)

Observes the given list of tables and views.

Public functions

abstract Unit

Called when one of the observed tables is invalidated in the database.

Public constructors

Observer

Added in 2.0.0
Observer(tables: Array<String>)

Protected constructors

Observer

Added in 2.0.0
protected Observer(firstTable: String, vararg rest: String)

Observes the given list of tables and views.

Parameters
firstTable: String

The name of the table or view.

vararg rest: String

More names of tables or views.

Public functions

onInvalidated

Added in 2.0.0
abstract fun onInvalidated(tables: Set<String>): Unit

Called when one of the observed tables is invalidated in the database.

Parameters
tables: Set<String>

A set of invalidated tables. This is useful when the observer targets multiple tables and you want to know which table is invalidated. This will be names of underlying tables when you are observing views.