What happens by default in absense of backpressure...
# rx
d
What happens by default in absense of backpressure support? For example here:
publishSubject.concatMap { Observable.delay(3000) }
If subject will very quickly emit a lot of items, what happens? Will they get buffered up to a certain point? Or not at all? Can one expect that quickly emitting 3 items will be OK, but 1 000 000 items will throw MissingBackrpressure? Where's that point when OK becomes an exception? :) I tried searching javadoc for this info, but didn't succeed. If this is documented, please point me to the place in the docs.
a
Observable
(and `Subject`s) will buffer forever until an OOM is hit. You should only receive a
MissingBackpressureException
when using a
Flowable
d
I see! Thanks for clarification!
u
I might be making this up but there is some internal config for the buffer, its 256 or something
g
It’s only default buffer size ( I think it’s 128 values)
a
My understanding is that `Observable`s will just keep buffering forever...For
Flowable
I know there's some type of internal, fixed size buffer that can buffer some amount (maybe 128/256?) before it crashes
u
if you look at the sources, almost all operators have a buffer overload, `
Copy code
BUFFER_SIZE = Math.max(1, Integer.getInteger("rx2.buffer-size", 128));
`
I wonder what happens after that .. does it block? or throw?
a
That's interesting. I know there's some internal buffering with the
observeOn
operator to improve performance for bursty sources but I'm not sure about those internal buffers