reactor-core/src/main/java/reactor/core/publisher/Flux.java
public static <T> Flux<T> from(Publisher<? extends T> source) {
		if (source instanceof Flux) {
			@SuppressWarnings("unchecked")
			Flux<T> casted = (Flux<T>) source;
			return casted;
		}

		if (source instanceof Fuseable.ScalarCallable) {
			try {
				@SuppressWarnings("unchecked") T t =
						((Fuseable.ScalarCallable<T>) source).call();
				if (t != null) {
					return just(t);
				}
				return empty();
			}
			catch (Exception e) {
				return error(e);
			}
		}
		return wrap(source);
	}
public static <T> Flux<T> from(Publisher<? extends T> source) {
		if (source instanceof Flux) {
			@SuppressWarnings("unchecked")
			Flux<T> casted = (Flux<T>) source;
			return casted;
		}

		if (source instanceof Fuseable.ScalarCallable) {
			try {
				@SuppressWarnings("unchecked") T t =
						((Fuseable.ScalarCallable<T>) source).call();
				if (t != null) {
					return just(t);
				}
				return empty();
			}
			catch (Exception e) {
				return error(e);
			}
		}
		return wrap(source);
	}
public static < T > Flux < T > from ( Publisher < ? extends T > source ) { if ( source instanceof Flux ) { @ SuppressWarnings ( "unchecked" ) Flux < T > casted = ( Flux < T > ) source ; return casted ; } if ( source instanceof Fuseable . ScalarCallable ) { try { @ SuppressWarnings ( "unchecked" ) T t = ( ( Fuseable . ScalarCallable < T > ) source ) . call ( ) ; if ( t != null ) { return just ( t ) ; } return empty ( ) ; } catch ( Exception e ) { return error ( e ) ; } } return wrap ( source ) ; }
Decorate the specified {@link Publisher} with the {@link Flux} API.
<p>
<img class="marble" src="doc-files/marbles/fromForFlux.svg" alt="">

@param source the source to decorate
@param <T> The type of values in both source and output sequences

@return a new {@link Flux}
Decorate the specified { @link Publisher } with the { @link Flux } API . <p > <img class = marble src = doc - files / marbles / fromForFlux . svg alt = >