Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Observable vs Flowable on Interfaces With Unknown Implementations #6724
We have a base library which provides interfaces for repository / database access and some basic implementations. In the case of getOne, insert, update, and delete, these all make sense as singles / maybes. However in the case of getAll for instance, this could be a
So now where we are stuck is whether or not these interfaces should return Observables or Flowables. From what I understand, the main difference between the two is that Flowables have added overhead which allow a Consumer to control the rate at which a Producer emits items, where as an Observable does not and will just emit as quickly as possible.
Would it make sense then to always return lower overhead Observables from these interfaces, and to leave it up to the consumer to use
No, they are for cases where there can't be a reasonable backpressure (UI events) or backpressure doesn't matter due to short sequences.