tripkit-android / com.skedgo.tripkit.a2brouting / RouteService / routeAsync

routeAsync

abstract fun routeAsync(query:Query, transportModeFilter:TransportModeFilter= object : TransportModeFilter {}, transitModeFilter:TransitModeFilter= object : TransitModeFilter {}): Observable<List<TripGroup>>

To find routes from A to B asynchronously.

Return

An Observable which emits multiple of list of TripGroups, and then completes. That means, when we subscribe it via Observable.subscribe, it will emit the first list of TripGroups. And then it will emit the second list of TripGroups. There may be a certain delay between the emission of the first TripGroup list and the second TripGroup list due to network latency.

By default, the returned Observable will operate on rx.schedulers.Schedulers.io. So be sure to Observable.observeOn with rx.android.schedulers.AndroidSchedulers.mainThread to render TripGroups on the main thread.