doOnBeforeTerminate

fun <T> Maybe<T>.doOnBeforeTerminate(action: () -> Unit): Maybe<T>

Calls the action when the Maybe signals a terminal event: onSuccess, onComplete or onError. The action is called before the observer is called.

Please refer to the corresponding RxJava document.