src/main/java/io/reactivex/Observable.java
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
    @CheckReturnValue
    @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public static <T> Observable<T> fromPublisher(Publisher<? extends T> publisher) {
        ObjectHelper.requireNonNull(publisher, "publisher is null");
        return RxJavaPlugins.onAssembly(new ObservableFromPublisher<T>(publisher));
    }
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
    @CheckReturnValue
    @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public static <T> Observable<T> fromPublisher(Publisher<? extends T> publisher) {
        ObjectHelper.requireNonNull(publisher, "publisher is null");
        return RxJavaPlugins.onAssembly(new ObservableFromPublisher<T>(publisher));
    }
Converts an arbitrary Reactive-Streams Publisher into an Observable.
<p>
<img width="640" height="344" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromPublisher.o.png" alt="">
<p>
The {@link Publisher} must follow the
<a href="https://github.com/reactive-streams/reactive-streams-jvm#reactive-streams">Reactive-Streams specification</a>.
Violating the specification may result in undefined behavior.
<p>
If possible, use {@link #create(ObservableOnSubscribe)} to create a
source-like {@code Observable} instead.
<p>
Note that even though {@link Publisher} appears to be a functional interface, it
is not recommended to implement it through a lambda as the specification requires
state management that is not achievable with a stateless lambda.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The source {@code publisher} is consumed in an unbounded fashion without applying any
backpressure to it.</dd>
<dt><b>Scheduler:</b></dt>
<dd>{@code fromPublisher} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>
@param <T> the value type of the flow
@param publisher the Publisher to convert
@return the new Observable instance
@throws NullPointerException if publisher is null
@see #create(ObservableOnSubscribe)