mg6maciej
02/17/2017, 9:38 AMwindow with something else, e.g.:
yourObservalble
.window(1, TimeUnit.SECONDS)
.flatMap { it.firstElement().toObservable() }
But I wonder why do you need the first element at the end of time window? throttleFirst seems like a useful thing.
Also, if you don't need it to be exactly at the end of time window, you could use a workaround like this:
yourObservable
.throttleFirst(1, TimeUnit.SECONDS)
.delay(500, TimeUnit.MILLISECONDS)
This will give you first element "on average" at the end of time window.