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

routeAsync

fun routeAsync(query:Query, transportModeFilter:TransportModeFilter, transitModeFilter: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.