Hello guys. A question about `PublishProcessor`s. ...
# rx
e
Hello guys. A question about `PublishProcessor`s. I have an external API sending an event from callback A then may or may not send event from callback B before another A event is sent. I would like to observe a sequence of A-B events, discarding eventual events from A without a subsequent B.
Copy code
aProcessor: ---a1---a2-a3---a4------>
bProcessor: -----b1------b2------b3->
obtaining result:
(a1,b1) -> (a3,b2) -> (a4,b3)
I also need to debounce the result by some milliseconds to avoid receiving too many events in a short time, but that is applied down the stream. I tried:
Copy code
aProcessor
.concatMap { bProcessor.first(-1).toFlowable() }
.debounce(300, TimeUnit.MILLISECONDS)
But I don't think concatMap is the correct operator to discard the old A events.