src/main/java/io/reactivex/Single.java
@CheckReturnValue
    @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Single<T> doFinally(Action onFinally) {
        ObjectHelper.requireNonNull(onFinally, "onFinally is null");
        return RxJavaPlugins.onAssembly(new SingleDoFinally<T>(this, onFinally));
    }
@CheckReturnValue
    @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Single<T> doFinally(Action onFinally) {
        ObjectHelper.requireNonNull(onFinally, "onFinally is null");
        return RxJavaPlugins.onAssembly(new SingleDoFinally<T>(this, onFinally));
    }
Calls the specified action after this Single signals onSuccess or onError 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="291" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.doFinally.png" alt="">
</p>
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code doFinally} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>
<p>History: 2.0.1 - experimental
@param onFinally the action called when this Single terminates or gets disposed
@return the new Single instance
@since 2.1