Questions tagged [rx-kotlin2]

RxKotlin 2 is a library that adds convenient extension functions to RxJava.

RxKotlin 2 is a lightweight library that adds convenient extension functions to RxJava 2 (see ). It can be found at https://github.com/ReactiveX/RxKotlin

106 questions
0
votes
0 answers

No `MissingBackpressureException` exception with `Flowable.interval` and blocking chain

Consider the following example: fun main() { Flowable.interval(1, TimeUnit.MILLISECONDS).map { Thread.sleep(1000) it }.blockingForEach { println(it) } } Do to missing backpressure, I would expect to get a MissingBackpressureException as…
user3612643
  • 5,096
  • 7
  • 34
  • 55
0
votes
1 answer

Using `onBackpressureLatest` to drop intermediate messages in blocking Flowable

I have a chain where I do some blocking IO calls (e.g. HTTP-call). I want the blocking call to consume a value, proceed without interrupting, but drop everything that is piling up meanwhile, and then consume the next value in the same…
user3612643
  • 5,096
  • 7
  • 34
  • 55
0
votes
1 answer

RxJava/RxKotlin: combineLatest that already completes if one source completes (not all)

Basically, I have two Flowables F and G and I want to use combineLatest on them, but I want the combined Flowable to already complete if F completes (even if G is still running). Here is an example of what I what to achieve with an ugly…
user3612643
  • 5,096
  • 7
  • 34
  • 55
0
votes
1 answer

How to set Rx Action Consumer in Kotlin DSL

I am investigating the development of a Kotlin DSL for RxKotlin commands I have something working however I would to improve my approach to setting Rx Action(s) and Consumer(s). The Code I have currently resembles this:- @SequenceDsl class…
Hector
  • 4,016
  • 21
  • 112
  • 211
0
votes
2 answers

switchOnNext operator does not emit for subscriptions after last inserted observable

First, some background (maybe there is a better way of doing this): We have a module that emits incoming Bluetooth messages on a specific Observable. We then process this messages, and finally subscribe at the end to send messages forward. This…
Daniferrito
  • 171
  • 8
0
votes
1 answer

How to concatEagerDelayError in RxJava2

How to implement a Observable.concatEagerDelayError or an equivalent in RxJava2/RxKotlin2 ? There is : Observable.concatEager Observable.concatDelayError But not : Observable.concatEagerDelayError What i have : fun getAll():…
DamienL
  • 577
  • 1
  • 5
  • 14
0
votes
2 answers

One Observable should emit items based on another Observable emitted items and both Observables are not connected

I have two different Observables which behaves as Observable one behavior -> This will get created and one DisposableObserver will get subscribed to it and reacts to items emitted by the Observable One. This will be running continuously until app is…
0
votes
2 answers

How can we buffer items in each milliseconds and stream each item at constant time interval

onNext method of publishSubject is calling continuously(in uneven time, approximately in 1 milliseconds) And requirement is to emit these item at every 1 second and data should not loss means should emit each item. …
Bhuvnesh
  • 1,055
  • 9
  • 29
0
votes
1 answer

Android rxKotlin crash in subcribe combineLatest

I want enable/disable button when code & name is not empty. My code: btnAddItem.isEnabled = false val codeIsValid = RxTextView.textChanges(txvCode) .debounce(350, TimeUnit.MILLISECONDS) .map { code -> …
Stuart
  • 18
  • 3
0
votes
0 answers

App is crashing without showing any error?

I am calling apis using retrofit and rxkotlin. But when I start fragment the app gets crash without any notification or does not show any error msg in the studio logcat. Here is the code. From here I am call the apis interface try { if…
Abhishek Borikar
  • 374
  • 1
  • 5
  • 15
0
votes
0 answers

How to check Observable?

Unfortunately, I can't understand how to check Observable. Depending on connection - I want to get my data from network or DB. I have a method that checks network connection: companion object { fun isConnected() : Observable { …
Andrew
  • 591
  • 2
  • 12
  • 33
0
votes
1 answer

How can I ensure the first Observable is subscribed before the second one emits in RxJava2?

Having read the article MODEL-VIEW-INTENT written by Hannes Dorfmann, I designed my app using the MVI pattern. This is my design chart of my application. I have two reusable fragments, BarFragment and ContentFragment. And my activity is made up of…
Jovi Phoe
  • 55
  • 9
0
votes
1 answer

How to chain an Observable with a Single in RxJava?

I am new to the Rx world so please bear with me. My code is in Kotlin but a Java code will help also. I have 2 methods, one of them loads tasks from the database, if there are tasks, I want to send them to the server. fun getListFromDb():…
0
votes
1 answer

How to call emitter.onComplete() when emitter.onNext() are on async loop

I have an Async call, in which callback listener I've put the emitter.onNext(). This async call is inside a for-in (I know the list size). I would like call onComplete() when last element has been emitted in onNext(). for (anItem in itemList) { …
lordneru
  • 700
  • 7
  • 19
0
votes
1 answer

RxKotlin - Wrong subscribeOn, observeOn thread changing for Subject out of Activity?

I have an object that generates different strings in the random moments of time, and i need to sudscribe to this generator to take these strings and provide them to ui (maybe it will be multiple subscribers in different activities). Suppose, i got…