src/main/java/io/reactivex/Completable.java
@CheckReturnValue
    @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public static Completable create(CompletableOnSubscribe source) {
        ObjectHelper.requireNonNull(source, "source is null");
        return RxJavaPlugins.onAssembly(new CompletableCreate(source));
    }
@CheckReturnValue
    @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public static Completable create(CompletableOnSubscribe source) {
        ObjectHelper.requireNonNull(source, "source is null");
        return RxJavaPlugins.onAssembly(new CompletableCreate(source));
    }
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static Completable create ( CompletableOnSubscribe source ) { ObjectHelper . requireNonNull ( source , "source is null" ) ; return RxJavaPlugins . onAssembly ( new CompletableCreate ( source ) ) ; }
Provides an API (via a cold Completable) that bridges the reactive world with the callback-style world.
<p>
<img width="640" height="442" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.create.png" alt="">
<p>
Example:
<pre><code>
Completable.create(emitter -&gt; {
Callback listener = new Callback() {
&#64;Override
public void onEvent(Event e) {
emitter.onComplete();
}

&#64;Override
public void onFailure(Exception e) {
emitter.onError(e);
}
};

AutoCloseable c = api.someMethod(listener);

emitter.setCancellable(c::close);

});
</code></pre>
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code create} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>
@param source the emitter that is called when a CompletableObserver subscribes to the returned {@code Completable}
@return the new Completable instance
@see CompletableOnSubscribe
@see Cancellable
Provides an API ( via a cold Completable ) that bridges the reactive world with the callback - style world . <p > <img width = 640 height = 442 src = https : // raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Completable . create . png alt = > <p > Example : <pre > <code > Completable . create ( emitter - &gt ; { Callback listener = new Callback () { &#64 ; Override public void onEvent ( Event e ) { emitter . onComplete () ; }