replay

fun <T> Observable<T>.replay(bufferSize: Int = Int.MAX_VALUE): ConnectableObservable<T>

Returns a ConnectableObservable that shares a single subscription to the source Observable and replays at most bufferSize elements emitted by the source Observable to any future subscriber.

Default buffer size is unlimited

Please refer to the corresponding RxJava document.