src/main/java/io/reactivex/Single.java
@CheckReturnValue
    @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Single<T> doOnDispose(final Action onDispose) {
        ObjectHelper.requireNonNull(onDispose, "onDispose is null");
        return RxJavaPlugins.onAssembly(new SingleDoOnDispose<T>(this, onDispose));
    }
@CheckReturnValue
    @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Single<T> doOnDispose(final Action onDispose) {
        ObjectHelper.requireNonNull(onDispose, "onDispose is null");
        return RxJavaPlugins.onAssembly(new SingleDoOnDispose<T>(this, onDispose));
    }
Calls the shared {@code Action} if a SingleObserver subscribed to the current Single
disposes the common Disposable it received via onSubscribe.
<p>
<img width="640" height="332" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.doOnDispose.png" alt="">
</p>
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code doOnDispose} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>
@param onDispose the action called when the subscription is disposed
@return the new Single instance
@throws NullPointerException if onDispose is null
@since 2.0