RxRoom

open class RxRoom
kotlin.Any
   ↳ androidx.room.RxRoom

Helper class to add RxJava2 support to Room.

Summary

Public constructors

This type should not be instantiated as it contains only static methods.

Public methods
open static Flowable<Any!>!
createFlowable(database: RoomDatabase!, vararg tableNames: String!)

Creates a Flowable that emits at least once and also re-emits whenever one of the observed tables is updated.

open static Observable<Any!>!
createObservable(database: RoomDatabase!, vararg tableNames: String!)

Creates a Observable that emits at least once and also re-emits whenever one of the observed tables is updated.

Properties
static Any!

Data dispatched by the publisher created by createFlowable(RoomDatabase, String...).

Public constructors

<init>

RxRoom()

Deprecated: This type should not be instantiated as it contains only static methods.

Public methods

createFlowable

open static fun createFlowable(database: RoomDatabase!, vararg tableNames: String!): Flowable<Any!>!

Creates a Flowable that emits at least once and also re-emits whenever one of the observed tables is updated.

You can easily chain a database operation to downstream of this Flowable to ensure that it re-runs when database is modified.

Since database invalidation is batched, multiple changes in the database may results in just 1 emission.

Parameters
database RoomDatabase!: The database instance
tableNames RoomDatabase!: The list of table names that should be observed
Return
Flowable<Any!>!: A Flowable which emits NOTHING when one of the observed tables is modified (also once when the invalidation tracker connection is established).

createObservable

open static fun createObservable(database: RoomDatabase!, vararg tableNames: String!): Observable<Any!>!

Creates a Observable that emits at least once and also re-emits whenever one of the observed tables is updated.

You can easily chain a database operation to downstream of this Observable to ensure that it re-runs when database is modified.

Since database invalidation is batched, multiple changes in the database may results in just 1 emission.

Parameters
database RoomDatabase!: The database instance
tableNames RoomDatabase!: The list of table names that should be observed
Return
Observable<Any!>!: A Observable which emits NOTHING when one of the observed tables is modified (also once when the invalidation tracker connection is established).

Properties

NOTHING

static val NOTHING: Any!

Data dispatched by the publisher created by createFlowable(RoomDatabase, String...).