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

Checking a list and timing out if all entries not found in RxJava/RxKotlin

I have a scenario where I have a function, scanForTargets, that returns an Observable of type FoundNumber. In FoundNumber I just need an ID field I can grab out of it. As each element comes back in the scanResults Observable, I want to check to see…
user443654
  • 821
  • 1
  • 7
  • 21
0
votes
2 answers

Setting RecyclerViews itemAnimator to null does not remove animations

My outer RecyclerView crashes either with IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true... or IllegalStateException: The specified child already has a parent. You must call removeView() on…
Eloraju
  • 84
  • 8
0
votes
2 answers

Flatten Observable of Observables

What I would like to do is create a function which runs another function every second. The second function returns Observables and I want the first function to return Observables as well instead of Observable> for…
godzsa
  • 2,105
  • 4
  • 34
  • 56
0
votes
1 answer

How to Merge multiple Observables with diferents call backs into one single Stream?

I have this problem. I'm trying to sync a local database into my android app with a remote app. I'm creating the logic to upload the new info created locally and the server responds with the remote id save it in the server. To archive this, I'm…
0
votes
2 answers

RxKotlin zip inside flatmap

This is my code template getLastMessageSingle() .flatmap( message-> if(message.image==null) Single.Just(message) else Single.zip(t1,t2,BiFunction{ s1,s2-> //body sets data to…
Arjun Gurung
  • 431
  • 3
  • 17
0
votes
1 answer

Kotlin, how can retry request if get error when tap on button of dialog

Let imagine situation on Kotlin, when we try get request but hasn't internet connection and we get error, then show AlertDialog, and we need retry request if user click on "positive button". This method check for exist user by phone number: override…
nicolas asinovich
  • 3,201
  • 3
  • 27
  • 37
0
votes
1 answer

Best way to cache data in Android with ViewModel and RxJava2

In my application I'm using RxJava2 and new class from Architecture Components ViewModel. In my case, I need to push SQL clause to ViewModel, which will do some magic and return Observable that will give me the data I need. Everything works fine,…
0
votes
1 answer

Sorting emissions in Rx using sorted() or toSortedList() not working

I'm trying to sort the emissions of an Observable using either sorted() or toSortedList(). Here's my code: bookshelfUseCase.addedBooks(uid, BookshelfRepositoryContract.READ_LIST) .flatMap { Observable.fromIterable(it) } …
Rahul Chowdhury
  • 1,110
  • 12
  • 23
0
votes
1 answer

How to create a extension function to make rx subscription to flowable cleaner?

I'm developing an android app using room and RxAndroid. The problem is that i'm using the next code to refresh the info in my recycler view. observable.subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) …
0
votes
1 answer

execute and return value from observable on retry predicate

perform a task with an observable and emit value private val performTask = io.reactivex.Observable.create({ emitter -> // do somethinf emitter.onNext(true) emitter.onComplete() }) // this is also another observable with retry. I…
Belvi Nosakhare
  • 3,107
  • 5
  • 32
  • 65
0
votes
1 answer

How do I avoid .zip(stream1, stream2, BiFun) subscribing to stream1 twice, when stream2 is based on stream1?

I am using firebase in android with some complex data. I need to save references and I'm getting problems with my zip operation, or the way I'm handling RX overall. I want to create a new A object with information about a certain B, and update my B…
0
votes
1 answer

RxJava/RxKotlin split stream depending on subtype

I have a stream of ResponseMessage which can be of different subtypes. I would like to split the stream into streams where I can handle each type in its own stream. My first try resulted in this which I can not see working out. file.readLines() …
user3139545
  • 6,882
  • 13
  • 44
  • 87
0
votes
1 answer

RxKotlin - Dynamic observers array

I'm using RxKotlin together with Retrofit 2 I'm trying figure out how to have dynamic list of observers on a single operation. The first observer should trigger the operation, and all additional observers should wait until the operation…
dor506
  • 5,246
  • 9
  • 44
  • 79
0
votes
2 answers

How to subscribe to PublishRelay from generic observable?

Kotlin Code: fun Observable.circuitBreaker(): Observable { val relay = PublishRelay.create() this.subscribe(relay) return relay.toFlowable(BackpressureStrategy.LATEST).toObservable() } Above is a Kotlin code which I'm trying to…
Dinesh Raja
  • 8,501
  • 5
  • 42
  • 81
0
votes
1 answer

Spring 5 and Kotlin 1.1 Coroutines: Type rx.Scheduler not present

I'm using Kotlin 1.1.4-3 with Spring-context 5.0.0.RELEASE. On starting project I get this error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'coroutineAnnotationBeanPostProcessor' defined in…
youhans
  • 6,101
  • 4
  • 27
  • 39
1 2 3
15
16