I'm using RxAndroid and RxJava with Kotlin to make various requests to APIs and reciving them asyncronylusly:
getClient().sendSomeData(data)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{
Log.i("upload", "data ok")
},
{
t ->
Log.e("upload", "data error: " + t.stackTrace)
}
);
getClient().sendSomeOtherData(otherData)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{
Log.i("upload", "otherData ok")
},
{
t ->
Log.e("upload", "data error: " + t.stackTrace)
}
);
And so on. What i want to do now is, sort of "wait" for all the api requests to finish and show the progress. How can i wait for all observables to be completed and get a callback with progress?