timeout

fun <T> Observable<T>.timeout(timeout: Duration, scheduler: Scheduler, other: Observable<T>? = null): Observable<T>

Returns an Observable that emits elements from the source Observable and counts a timeout specified by timeout. If the timeout ever hits, disposes the source Observable and subscribes to the other Observable, if any.

Please refer to the corresponding RxJava document.