# RxRoom

# RxRoom

Artifact:[androidx.room:room-rxjava2](https://developer.android.com/jetpack/androidx/releases/room)  
[View Source](https://cs.android.com/search?q=file:androidx/room/RxRoom.kt+class:androidx.room.RxRoom)  
Added in[2.0.0](https://developer.android.com/jetpack/androidx/releases/room#2.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/room/RxRoom "View this page in Java")
Common/AllAndroid/JVMNative/C/iOSJavaScript
  - android  

  ```
  open class RxRoom
  ```

*** ** * ** ***

## Summary

|                                                                   ### Public companion functions                                                                    |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| [Flowable](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html)`<`[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`>`     | [createFlowable](https://developer.android.com/reference/kotlin/androidx/room/RxRoom#createFlowable(androidx.room.RoomDatabase,kotlin.Array))`(database: `[RoomDatabase](https://developer.android.com/reference/kotlin/androidx/room/RoomDatabase)`, vararg tableNames: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Creates a[Flowable](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html)that emits at least once and also re-emits whenever one of the observed tables is updated.         | android |
| [Observable](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`>` | [createObservable](https://developer.android.com/reference/kotlin/androidx/room/RxRoom#createObservable(androidx.room.RoomDatabase,kotlin.Array))`(database: `[RoomDatabase](https://developer.android.com/reference/kotlin/androidx/room/RoomDatabase)`, vararg tableNames: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Creates a[Observable](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)that emits at least once and also re-emits whenever one of the observed tables is updated. | android |

|                       ### Public companion properties                       |
|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) | [NOTHING](https://developer.android.com/reference/kotlin/androidx/room/RxRoom#NOTHING()) Data dispatched by the publisher created by[createFlowable](https://developer.android.com/reference/kotlin/androidx/room/RxRoom.Companion#createFlowable(androidx.room.RoomDatabase,kotlin.Boolean,kotlin.Array,kotlin.Function1)). | android |

|                                                                                          ### Public constructors                                                                                           |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| ~~[RxRoom](https://developer.android.com/reference/kotlin/androidx/room/RxRoom#RxRoom())~~`()` **This function is deprecated.**This type should not be instantiated as it contains only utility functions. | android |

## Public companion functions

### createFlowable

android  
Added in[2.7.0](https://developer.android.com/jetpack/androidx/releases/room#2.7.0)  

```
fun createFlowable(database: RoomDatabase, vararg tableNames: String): Flowable<Any>
```

Creates a[Flowable](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html)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](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html)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](https://developer.android.com/reference/kotlin/androidx/room/RoomDatabase)  | The database instance                           |
| `vararg tableNames: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | The list of table names that should be observed |

|                                                                             Returns                                                                             |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Flowable](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html)`<`[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`>` | A[Flowable](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html)which emits[NOTHING](https://developer.android.com/reference/kotlin/androidx/room/RxRoom#NOTHING())when one of the observed tables is modified (also once when the invalidation tracker connection is established). |

### createObservable

android  
Added in[2.7.0](https://developer.android.com/jetpack/androidx/releases/room#2.7.0)  

```
fun createObservable(database: RoomDatabase, vararg tableNames: String): Observable<Any>
```

Creates a[Observable](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)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](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)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](https://developer.android.com/reference/kotlin/androidx/room/RoomDatabase)  | The database instance                           |
| `vararg tableNames: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | The list of table names that should be observed |

|                                                                               Returns                                                                               |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Observable](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`>` | A[Observable](https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)which emits .NOTHING when one of the observed tables is modified (also once when the invalidation tracker connection is established). |

## Public companion properties

### NOTHING

android  

```
val NOTHING: Any
```

Data dispatched by the publisher created by[createFlowable](https://developer.android.com/reference/kotlin/androidx/room/RxRoom.Companion#createFlowable(androidx.room.RoomDatabase,kotlin.Boolean,kotlin.Array,kotlin.Function1)).

## Public constructors

### RxRoom

android  
Added in[2.0.0](https://developer.android.com/jetpack/androidx/releases/room#2.0.0)  
Deprecated in[2.0.0](https://developer.android.com/jetpack/androidx/releases/room#2.0.0)  

```
[RxRoom](https://developer.android.com/reference/kotlin/androidx/room/RxRoom#RxRoom())()
```
| **This function is deprecated.**   
| This type should not be instantiated as it contains only utility functions.