https://kotlinlang.org logo
#rx
Title
# rx
u

ursus

11/11/2019, 5:01 PM
so I have a list of requests, which I want to upload, however only 5 parallel are allowed, so I have a new scheduler for that, it works, however what the issue is that Observable.fromIterable(it) splits it to per item, but, subscriptions to
upload
seem to be race-y, and not in the order of the list
p

Paul Woitaschek

11/12/2019, 1:33 PM
Like this?
Copy code
fun doStuff(listOfRequests: Observable<List<Request>>) {
    listOfRequests.flatMap { requests ->
      val uploads = requests.map { upload(it).toObservable<Nothing>() }
      Observable.concatEager(uploads, 5, 0)
    }
  }
u

ursus

11/12/2019, 2:34 PM
Is that different from listsOfRequests.concatMapEager ?
if not then, subscribes are race-y, just outputs are ordered
3 Views