Questions tagged [reactivex]

ReactiveX is a library for composing asynchronous and event-based programs by using observable sequences.

From reactivex.io:

It extends the observer pattern to support sequences of data and/or events and adds operators that allow you to compose sequences together declaratively while abstracting away concerns about things like low-level threading, synchronization, thread-safety, concurrent data structures, and non-blocking I/O.

688 questions
0
votes
2 answers

Mark method as should never be used

i would like to know if there is some good way in java to show that some method should never be invoked? I'm thinking in case that I work with bigger team, and to tell guys that this method will never be invoked, so don't try to test it. Maybe…
Kamil Banaszczyk
  • 1,133
  • 1
  • 6
  • 23
0
votes
1 answer

Chained rxjs Observable operators

I'm relatively new to the ReactiveX principles, but I'm a big fan so far of what I've learned. I have a challenge that I've put a little thought into, but I'd like to get a more experienced opinion on: I have a few methods which return an…
Daniel Patrick
  • 3,980
  • 6
  • 29
  • 49
0
votes
2 answers

Is Error Considered an Emission from an Observable in RxJs?

Quick question: Will .do() fire off when there is an error? The docs say, "Perform a side effect for every emission on the source Observable, but return an Observable that is identical to the source." Is an error considered an emission, too? return…
wolfhoundjesse
  • 1,085
  • 9
  • 32
0
votes
1 answer

Postpone observable when other one fired in RxJs

I have a table on a page and two subscriptions: First one reloads table data. It has a delay because it calls an api. Second highlights data. Does not affect table data. When subscriptions fire one by one everything is OK, but when they fire at…
Sergey Sokolov
  • 2,709
  • 20
  • 31
0
votes
1 answer

Many observer connected to one observable receive events one at a time

This is how I create my observable: Observable.fromCallable(new EventObtainer()).flatMap(Observable::from).subscribeOn(Schedulers.io()).repeat(); And after that, through http request i'm trying to add different observers. The thing is that if I…
Kamil Banaszczyk
  • 1,133
  • 1
  • 6
  • 23
0
votes
2 answers

RxJS/ReactiveX Proper modules communication

I'm pretty new to Reactive Programming but already in love. However it is still hard to switch my brain to it. I'm trying to follow all recommendations as "Avoid using subjects" and "Avoid impure functions" and of course "Avoid imperative…
Pavel Kolev
  • 111
  • 8
0
votes
1 answer

buffer_with_count behavior is different on an interval observable than on a range observable. Why?

I am trying out RxPy and I am not understanding this behavior for the buffer_with_count operator: Scenario 1: An interval observable This one works as I expect. No Buffer >>>…
Carlos Mermingas
  • 3,822
  • 2
  • 21
  • 40
0
votes
1 answer

reactivex: taking combination of take and takeLast in a sort of window function

I am a relative newbie to ReactiveX and have learned about Rx.Observable.take and Rx.Observable.takeLast to take from the beginning and end of a sequence respectively and Rx.Observable.windowWithCount to take potentially overlapping windows from an…
mikesol
  • 1,177
  • 1
  • 11
  • 20
0
votes
2 answers

Downloading a file in grails using JavaRx / rx-mongodb

I am trying to download a file in Grails 3.2.1. I have a org.bson.types.Binary Type called "file" saved in mongo-db. The size of the files stored are in kb so no need for GridFS. I can access the byte[] using the getData() helper that…
0
votes
2 answers

Add more Subscription when pull to refresh with Reactive Android

I wrote code to get data from server and display to list view. And I also add pull to refresh feature. I wonder if we add more subscription when pull to refresh is called so is it best practice or should I unsubscribe before I add the new…
Khoa Tran
  • 528
  • 6
  • 18
0
votes
1 answer

angular2 & typescript & reactiveX : how to cast http get result

Lets suppose we have a rest api at this url /api/stuffs/ where we can get a list of Stuff. here is the code to http get the list of Stuff: getStuffs(): Observable { return this.http.get(this.url) .map(this.extractStuffs) …
dafriskymonkey
  • 2,189
  • 6
  • 25
  • 48
0
votes
1 answer

RxSwift throttle() to get first element

I am looking for a way in which the throttle() operator gives up the first element in an Observable within a given time-interval, rather than the last element. A similar question has been asked (and answered) in RxSwift - Debounce/Throttle…
RamwiseMatt
  • 2,717
  • 3
  • 16
  • 22
0
votes
1 answer

RxScala based on RxJava 2.0

RxJava 2.0 is close to be finished (RC3). Is there an (experimental) RxScala implementation that is based on this version? RxJava 2.0 targets Java 8. Does this have any implications on RxScala, e.g. will Scala 2.12 be a prerequisite?
0
votes
1 answer

Is it possible to make `ReplaySubject` to run a closure on being subscribed to?

I want to create a cold observable that would only start doing expensive operation if there is an actual subscription. ReplaySubject would fit nicely except for the part that I need to be able to start an expensive background operation when the…
0x416e746f6e
  • 9,872
  • 5
  • 40
  • 68
0
votes
1 answer

Resubscribing an observable if timeout exception occurs

i'm using retrofit to return an observable as a result of REST API call to server. Its very usual that a request timeout exception occurs and observable stops executing. How to resubscribe of retry if exception is of a specific type myObservable …
Arsal
  • 565
  • 2
  • 8
  • 17