Questions tagged [rx-kotlin]

RxJava bindings for Kotlin programming language

RxKotlin is open sourced and available under the Apache License, Version 2.0

238 questions
0
votes
1 answer

Using Observable in Kotlin to parse a API response

I am trying to parse the data from the server to my mobile device and I am using Rx , Kotlin , retrofit for this ApiInterface.kt @GET("api/v1/admin/class/getUsers/learner/{classId}") fun getStudentsRx( @Header("access_token")…
Devrath
  • 42,072
  • 54
  • 195
  • 297
0
votes
1 answer

Combine three APIs' result in RxKotlin

I have a function in repository that calls three APIs which return three different type of Objects. fun scanSource(code: String) = firstApi.DataV11Get(code) .flatMap { firstApi.sccGet(it.sscc) } .flatMap { …
Syeda Zunaira
  • 5,191
  • 3
  • 38
  • 70
0
votes
1 answer

Ensure sequential state update when using RXJava scan operator

I'm trying to implement redux state update pattern using RXJava val subject=PublishSubject.create() val subject1=PublishSubject.create() // multiple threads posting // on subject and subject1 here. Concurrently subject.mergeWith(subject1) …
0
votes
1 answer

How to handle errors on RxKotlin + Graphql

I am getting: io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call I had tried to add .doOnError { error -> Log.i("reverser code…
Sandip
  • 43
  • 1
  • 6
0
votes
1 answer

Emit events after non periodic intervals using rx java

I want to emit events after non periodic intervals and I want to set the interval for emission of each event programatically using Rxjava in Android. How do I do that?
NIKHIL AGGARWAL
  • 448
  • 4
  • 9
0
votes
2 answers

Kotlin: How to Output at a time the ArrayList from Rxjava

I want to print at a time of ArrayList. Before: class ExampleUnitTest { @Test fun test(){ val stringArray = arrayOf("10", "20", "30", "40", "30", "20", "10", "5", "20", "30", "20", "30").map { it } …
un Lim
  • 75
  • 1
  • 7
0
votes
1 answer

How to force stop thread

I have PublishSubject for observing status change and also I have method with multiple steps, which I execute in another thread. How I can force stop this thread when subject received changes?
Daria
  • 347
  • 2
  • 5
  • 18
0
votes
1 answer

Fetching a Single for all elements of another Single in RxKotlin

A, B, C are objects All function calls are made to a Rooms DB This code snippet is inside a ViewModel repo = Repository So I'm making an android app (can't provide details) and for a particular screen I need to do the following. My first call is…
kzKhan
  • 3
  • 1
0
votes
1 answer

Mapping elements of collection from RX Single/Observable

In my project, I use RxJava/RxKotlin bindings to communicate with REST API. The API sometimes returns a list of elements, that need to be altered/mapped, before I can use them. Currently, mapping of these elements is done by nested .map() and…
ikurek
  • 604
  • 11
  • 27
0
votes
1 answer

Composing two observable sources using one as a predicate in RxJava

I have 2 observable sources where fetchProductList() returns Observable and other canInvite.execute() takes a value and returns a Single. I need to compose the stream to feed every emission from first source to the second in a…
0
votes
1 answer

Is it possible to implement an operator like delay but that also delays errors?

I'm trying for some time now to implement an extension function (just becuse it's easier to me) that is capable of delaying both normal item emissions and errors. The existing delay operators only delays normal item emissions, errors are delivered…
0
votes
1 answer

Model properties binding in android viewmodel

I've tried some examples with viewmodels and databinding using BehaviorSubjects and other Observables. Now I have real (data class) object in Kotlin, which holds most of the state. It is basically pojo, but independent from viewmodel and has no…
K.H.
  • 1,383
  • 13
  • 33
0
votes
1 answer

main function is dead while rxjava is working. any solution please

I am trying to get access_token with RXjava. I ran the program and called the function that requests the access_token, but the process finishes with code 0. I think the main thread is dead while connecting the server my solution…
aguagu
  • 83
  • 5
0
votes
0 answers

Android - Replacing One interface with other one using rx-kotlin

I have a three layers in my application app, data, domain, i will be getting my result entity for my app from domain layer , the result entity class will be implementing with some interface L1, my need is when the result reaches app layer i need to…
Stack
  • 1,164
  • 1
  • 13
  • 26
0
votes
1 answer

Rxkotlin - How to zip more than three observables with zip operator

I need to zip more than 3 observables with zip operator in rxkotlin, but when i try to zip more than 3 it shows me compile time error. Example …
Stack
  • 1,164
  • 1
  • 13
  • 26