src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Observable<T> doAfterTerminate(Action onFinally) {
        ObjectHelper.requireNonNull(onFinally, "onFinally is null");
        return doOnEach(Functions.emptyConsumer(), Functions.emptyConsumer(), Functions.EMPTY_ACTION, onFinally);
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Observable<T> doAfterTerminate(Action onFinally) {
        ObjectHelper.requireNonNull(onFinally, "onFinally is null");
        return doOnEach(Functions.emptyConsumer(), Functions.emptyConsumer(), Functions.EMPTY_ACTION, onFinally);
    }
Registers an {@link Action} to be called when this ObservableSource invokes either
{@link Observer#onComplete onComplete} or {@link Observer#onError onError}.
<p>
<img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doAfterTerminate.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code doAfterTerminate} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param onFinally
an {@link Action} to be invoked when the source ObservableSource finishes
@return an Observable that emits the same items as the source ObservableSource, then invokes the
{@link Action}
@see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
@see #doOnTerminate(Action)