Questions tagged [rx-java]

RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.

RxJava is a Java implementation of Reactive Extensions. Android-specific support for RxJava is provided by .

The main goals of RxJava

  • Stay true to the principles and concepts behind the original implementation while adjusting to the naming conventions and idioms of Java
  • All contracts of Rx should be the same target - the JVM
  • JVM-based languages supported (beyond Java itself) include , , , and
  • Support Java 6+

The library is open sourced under Apache 2.0 license.

References

6958 questions
3
votes
1 answer

RxJava, Proguard and sun.misc.Unsafe

I have problems with RxJava (1.1.0) when using Proguard. I didn't change RxJava version nor its .pro file, but after updating OkHttp I couldn't compile using Proguard because I had warnings about sun.misc.Unsafe not being present. rxJava.pro -keep…
David Corsalini
  • 7,958
  • 8
  • 41
  • 66
3
votes
1 answer

Vertx - Is it possible to combine RxJava and Hibernate

I wnted to know if its possible to use this: https://github.com/vert-x3/vertx-rx with https://github.com/vert-x3/vertx-jdbc-client and you add Hibernate for the named queries / DAO access. How to make Hibernate non blocking I/O?
jihedMaster
  • 331
  • 1
  • 3
  • 11
3
votes
2 answers

How to obtain a correct type when returning Template from a static function with null

I'm trying some Rx and Kotlin. Suppose I have a function that returns Observable: public fun get():Observable { return if (someCondition()) { Observable.just(someLocalVarOfTypeT) } else { Observable.just(null) …
Motorro
  • 227
  • 2
  • 10
3
votes
1 answer

Return only emitted items from an Observable

I want to get emitted items from an Observable stream. I can do this in Collection streams with the following code: List items = Arrays.asList("a", "b"); String result = items.stream().filter(i -> i.equals("a")).findFirst().orElse(""); I…
Mert Nuhoglu
  • 9,695
  • 16
  • 79
  • 117
3
votes
3 answers

RxJava - Why the executors only use one thread

I have created a fixed thread-pool to process an event emit per 300 milliseconds and assume the process need 1000 millisecond. Suppose the multi-thread will work but only one thread reused. If i set the sleepTime smaller than 300ms, the processing…
Rockman12352
  • 101
  • 10
3
votes
2 answers

RxJava building cache with observables for android

I'm having a hard time understanding on how to build a cache using RxJava. The idea is that I need to either get data from a memory cache or load from my database (dynamoDb). However, this cache is supposed to be shared across fragments and or…
Sun
  • 2,658
  • 6
  • 28
  • 33
3
votes
2 answers

Proper termination of a stuck Couchbase Observable

I'm trying to delete a batch of couchbase documents in rapid fashion according to some constraint (or update the document if the constraint isn't satisfied). Each deletion is dubbed a "parcel" according to my terminology. When executing, I run into…
KidCrippler
  • 1,633
  • 2
  • 19
  • 34
3
votes
1 answer

RxKotlin: trying to add custom errors catching

I'm trying to write my own extension function for RxKotlin which would make an Observable handle a specific error type (Throwable subclass) with a handler which is passed as an argument and emit no more items. Marble diagram would be: --- a --- b…
hotkey
  • 140,743
  • 39
  • 371
  • 326
3
votes
1 answer

On demand execution of hot Observable

Given a cold example: Observable cold = Observable.create(subscriber -> { try { for (int i = 0; i <= 42; i++) { // avoid doing unnecessary work if (!subscriber.isUnsubscribed()) { break; } …
vach
  • 10,571
  • 12
  • 68
  • 106
3
votes
2 answers

What's the updated version of Manual Recursion to polling using Observables?

A little bit of context: In this link: https://github.com/ReactiveX/RxJava/issues/448 @ben-lesh proposed a Manual Recursion implementation to polling using Observables. However in latest RxJava version there is no OnSubscribeFunc. Here it is my…
3
votes
2 answers

Observable composed of cold and hot observables

I'm having hard time finding proper way of composing an observable which will emit all items from the given cold observable A and as soon as its completes continue with hot observable B. This is my specific use case : I have a data collector which…
vach
  • 10,571
  • 12
  • 68
  • 106
3
votes
1 answer

Returning an ArrayList of an object in rxAndroid

I want to run a method periodically such that it returns an ArrayList of a custom object. Here is my code snippet, subscribe = Observable.interval(5, TimeUnit.SECONDS) .map(new Func1>() { …
yadav_vi
  • 1,289
  • 4
  • 16
  • 46
3
votes
2 answers

How to subscribe again to Observable without start new process?

I have Observable Observable observable = Observable.create(new Observable.OnSubscribe() { @Override public void call(Subscriber subscriber) { if (subscriber.isUnsubscribed()) { …
NickUnuchek
  • 11,794
  • 12
  • 98
  • 138
3
votes
2 answers

Mysterious issue with okhttp call (SocketTimeException)

I am using Okhttp 2.5, 2.6, 2.7 with RxJava and Retrofit 2. I got some mysterious issue with okhttp call. When I made call with retrofit my Okhttp interceptor get called immediately while NetworkInterceptor called after 4 to 5 second. Sometime its…
3
votes
1 answer

RxAndroid Simplify a common pattern?

I find myself writing over and over again: Observable.create(new Observable.OnSubscribe() { @Override public void call(Subscriber subscriber) { try { …
user47376
  • 2,263
  • 3
  • 21
  • 26
1 2 3
99
100