doOnBeforeTerminate

Calls the action when the Completable signals a terminal event: either onComplete or onError. The action is called before the observer is called.

Please refer to the corresponding RxJava document.