Closed bnvinay92 closed 6 years ago
All 5 subscribeOn's enqueue on the scheduler before the first insert completes. Thus, the enqueued notifications happen after all 5 inserts complete.
Even if you received the notifications immediately the output is probabilistic in nature at best. We only send a notification of a change and not the actual change itself. When you eventually call/trigger run()
on the Query
object the data in the underlying table could have been changed.
I'm initialising BriteDatabase with
Schedulers.single()
and executing a query on a table then writing 5 items to the same table on the same scheduler, namelySchedulers.single()
.I'm receiving all 5 notifications only after all 5 writes, so my query emits the same (last) item 5 times.
A
PUT
looks something like this:Even when I read and write on separate threads, I get inconsistent notifications.