take While
Returns an Observable that checks the specified predicate for each element emitted by the source Observable, and emits the element if the predicate returned true or completes if it returned false.
Please refer to the corresponding RxJava document.