title: Room with Kotlin-coroutines observe db changes
body: <p>So, I recently started experimentation with coroutines, I switched from Rxjava2 to coroutines, I haven't got a grasp of it yet but still, I ran into a condition where I needed to observe my database change and update the UI corresponding to that.</p>
  
  <p>RxJava used to provide me with Flowables, Completeable etc.  using that I would be able to observe changes in Db.</p>
  
  <pre><code>    abstract fun insert(data: SomeData): Long
  
      @Query("SELECT * FROM somedata_table")
      abstract fun getData(): Flowable&lt;List&lt;SomeData&gt;&gt;
  </code></pre>
  
  <p>So here now I used to subscribe to getData and always used to observe changes</p>
  
  <p>Now Enter coroutines, I am using a suspended function with a deferred result to return my responses</p>
  
  <pre><code>    @Insert(onConflict = OnConflictStrategy.IGNORE)
      abstract fun insert(data: SomeData): Long
  
      @Query("SELECT * FROM somedata_table")
      abstract fun getData(): List&lt;SomeData&gt;
  </code></pre>
  
  <pre><code>suspend fun getAllSomeData():Deferred&lt;List&lt;SomeData&gt;&gt;{
          return GlobalScope.async (context= coroutineContext){
              database.myDao().getData()
          }
      }
  </code></pre>
  
  <p>Now I have no way to listen for updates, <strong>Channels</strong> in coroutines might be the right answer? but I am not sure how to use it with Room.</p>