These are chat archives for ReactiveX/RxJava

3rd
May 2016
Dorus
@Dorus
May 03 2016 01:38
@dwursteisen I understand why you use .never(), but right now your source wont ever complete even when both wait and data have completed right? That's a bit of a leak.
dwursteisen
@dwursteisen
May 03 2016 12:55
It will complete after the last buffer
Vadym A. Dragan
@ardoramor
May 03 2016 20:10
Hello! Can anyone suggest an approach to the following. I am collecting several sensors in android and also location points. Location is collected less frequently. I'm trying to figure out if there is an operator that would allow me to buffer other sensor data between location onNext emissions. This buffer operator would be applied to each sensor, then calculate min, max, avg and be combined with the location data.
I know that there are buffer and a few other operators like window but they all rely upon time segment
This has a bit of a different requirement
Dorus
@Dorus
May 03 2016 21:10

@ardoramor Something like

Observable.zip(
  location,
  sensor1.window(location).flatMap(window.reduce(...)),
  sensor2.window(location).flatMap(window.reduce(...)),
  (location, sensor1, sensor2) -> ...)

?
Might be a good idea to add a little extra logic that ensures every window as at least some data, like the previouse value if the current window is empty.

Vadym A. Dragan
@ardoramor
May 03 2016 21:20
@Dorus wow, that's brilliant! I missed it because I'm coming from rxjs and remembered only one flavor of window. Thank you!
Dorus
@Dorus
May 03 2016 21:21
RxJs has the same flavours
Vadym A. Dragan
@ardoramor
May 03 2016 21:47
I meant that I used only one and it got stuck in my head XD
Dorus
@Dorus
May 03 2016 21:48
Its always good to learn new ticks :)