src/main/java/io/reactivex/Flowable.java
@CheckReturnValue
    @BackpressureSupport(BackpressureKind.PASS_THROUGH)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Flowable<T> doOnTerminate(final Action onTerminate) {
        return doOnEach(Functions.emptyConsumer(), Functions.actionConsumer(onTerminate),
                onTerminate, Functions.EMPTY_ACTION);
    }
@CheckReturnValue
    @BackpressureSupport(BackpressureKind.PASS_THROUGH)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Flowable<T> doOnTerminate(final Action onTerminate) {
        return doOnEach(Functions.emptyConsumer(), Functions.actionConsumer(onTerminate),
                onTerminate, Functions.EMPTY_ACTION);
    }
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doOnTerminate ( final Action onTerminate ) { return doOnEach ( Functions . emptyConsumer ( ) , Functions . actionConsumer ( onTerminate ) , onTerminate , Functions . EMPTY_ACTION ) ; }
Modifies the source Publisher so that it invokes an action when it calls {@code onComplete} or
{@code onError}.
<p>
<img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnTerminate.png" alt="">
<p>
This differs from {@code doAfterTerminate} in that this happens <em>before</em> the {@code onComplete} or
{@code onError} notification.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator doesn't interfere with backpressure which is determined by the source {@code Publisher}'s
backpressure behavior.</dd>
<dt><b>Scheduler:</b></dt>
<dd>{@code doOnTerminate} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param onTerminate
the action to invoke when the source Publisher calls {@code onComplete} or {@code onError}
@return the source Publisher with the side-effecting behavior applied
@see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
@see #doAfterTerminate(Action)
Modifies the source Publisher so that it invokes an action when it calls { @code onComplete } or { @code onError } . <p > <img width = 640 height = 305 src = https : // raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnTerminate . png alt = > <p > This differs from { @code doAfterTerminate } in that this happens <em > before< / em > the { @code onComplete } or { @code onError } notification . <dl > <dt > <b > Backpressure : < / b > < / dt > <dd > The operator doesn t interfere with backpressure which is determined by the source { @code Publisher } s backpressure behavior . < / dd > <dt > <b > Scheduler : < / b > < / dt > <dd > { @code doOnTerminate } does not operate by default on a particular { @link Scheduler } . < / dd > < / dl >