src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Observable<T> doFinally(Action onFinally) {
        ObjectHelper.requireNonNull(onFinally, "onFinally is null");
        return RxJavaPlugins.onAssembly(new ObservableDoFinally<T>(this, onFinally));
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Observable<T> doFinally(Action onFinally) {
        ObjectHelper.requireNonNull(onFinally, "onFinally is null");
        return RxJavaPlugins.onAssembly(new ObservableDoFinally<T>(this, onFinally));
    }
Calls the specified action after this Observable signals onError or onCompleted or gets disposed by
the downstream.
<p>In case of a race between a terminal event and a dispose call, the provided {@code onFinally} action
is executed once per subscription.
<p>Note that the {@code onFinally} action is shared between subscriptions and as such
should be thread-safe.
<p>
<img width="640" height="281" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doFinally.o.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code doFinally} does not operate by default on a particular {@link Scheduler}.</dd>
<dt><b>Operator-fusion:</b></dt>
<dd>This operator supports boundary-limited synchronous or asynchronous queue-fusion.</dd>
</dl>
<p>History: 2.0.1 - experimental
@param onFinally the action called when this Observable terminates or gets disposed
@return the new Observable instance
@since 2.1