src/main/java/io/reactivex/Flowable.java
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.SPECIAL)
    @SchedulerSupport(SchedulerSupport.NONE)
    public static <T> Flowable<T> create(FlowableOnSubscribe<T> source, BackpressureStrategy mode) {
        ObjectHelper.requireNonNull(source, "source is null");
        ObjectHelper.requireNonNull(mode, "mode is null");
        return RxJavaPlugins.onAssembly(new FlowableCreate<T>(source, mode));
    }
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.SPECIAL)
    @SchedulerSupport(SchedulerSupport.NONE)
    public static <T> Flowable<T> create(FlowableOnSubscribe<T> source, BackpressureStrategy mode) {
        ObjectHelper.requireNonNull(source, "source is null");
        ObjectHelper.requireNonNull(mode, "mode is null");
        return RxJavaPlugins.onAssembly(new FlowableCreate<T>(source, mode));
    }
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . SPECIAL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Flowable < T > create ( FlowableOnSubscribe < T > source , BackpressureStrategy mode ) { ObjectHelper . requireNonNull ( source , "source is null" ) ; ObjectHelper . requireNonNull ( mode , "mode is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableCreate < T > ( source , mode ) ) ; }
Provides an API (via a cold Flowable) that bridges the reactive world with the callback-style,
generally non-backpressured world.
<p>
Example:
<pre><code>
Flowable.&lt;Event&gt;create(emitter -&gt; {
Callback listener = new Callback() {
&#64;Override
public void onEvent(Event e) {
emitter.onNext(e);
if (e.isLast()) {
emitter.onComplete();
}
}

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

AutoCloseable c = api.someMethod(listener);

emitter.setCancellable(c::close);

}, BackpressureStrategy.BUFFER);
</code></pre>
<p>
You should call the FlowableEmitter onNext, onError and onComplete methods in a serialized fashion. The
rest of its methods are thread-safe.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The backpressure behavior is determined by the {@code mode} parameter.</dd>
<dt><b>Scheduler:</b></dt>
<dd>{@code create} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <T> the element type
@param source the emitter that is called when a Subscriber subscribes to the returned {@code Flowable}
@param mode the backpressure mode to apply if the downstream Subscriber doesn't request (fast) enough
@return the new Flowable instance
@see FlowableOnSubscribe
@see BackpressureStrategy
@see Cancellable
Provides an API ( via a cold Flowable ) that bridges the reactive world with the callback - style generally non - backpressured world . <p > Example : <pre > <code > Flowable . &lt ; Event&gt ; create ( emitter - &gt ; { Callback listener = new Callback () { &#64 ; Override public void onEvent ( Event e ) { emitter . onNext ( e ) ; if ( e . isLast () ) { emitter . onComplete () ; } }