These are chat archives for ReactiveX/RxJava

Nov 2016
Nov 27 2016 03:55
Hello Rx java i am using Rx Java for the open source project and got the following exception Caused by: rx.exceptions.MissingBackpressureException: PublishSubject: could not emit value due to lack of requests. what would be the best Backpressure strategy to use when i cant afford loosing messages and dont want to buffer to many messages ? can someone better explain this exception? Thanks in advance !
David Karnok
Nov 27 2016 08:20
@ronenhamias What is your data source? For what chain do you get the error? You could switch to a built-in source that does honor backpressure. Otherwise, you have to buffer or drop values.
Nov 27 2016 08:22

i am accepting messages on netty listener ```@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
Message message = (Message) msg;
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Received: {}", message);



and consumers subscribe on the subject
  public final Observable<Message> listen() {
    checkState(!stopped, "Transport is stopped");
    return incomingMessagesSubject.onBackpressureBuffer(DEFAULT_BUFFER_LIMIT).asObservable();
currently using onBackpressureBuffer
David Karnok
Nov 27 2016 08:25
I see. I don't know enough about Netty but RxNetty does seem to work without backpressure problems. Otherwise, you have to tie the reading of a channel to the request amount of the downstream by building a custom operator and not using PublishSubject.
Nov 27 2016 08:32
i will look deeper into RxNetty
Stanislav Shakirov
Nov 27 2016 10:27

Hello! I need to make request after complete of changing ui.

.filter { it is EditComplete }
.flatMap { doRequest }
.doOnNext { updateUi }

Can I cancel(unsubscribe) from doRequest if got new event?

I can create subscription inside flatMap and cancel it every time I got emitting. But can it be solved ussing operators only?
Nov 27 2016 12:04
@punksta yeah you can use switch for that.