Skip to content

Commit

Permalink
tweak Mono.fromDirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Maldini committed Jun 29, 2017
1 parent 77e3b8b commit 5b9942b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions reactor-core/src/main/java/reactor/core/publisher/Mono.java
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ public static <T> Mono<T> fromCompletionStage(CompletionStage<? extends T> compl
* @return a wrapped {@link Mono}
*/
public static <I> Mono<I> fromDirect(Publisher<? extends I> source){
if(source instanceof Mono){
@SuppressWarnings("unchecked")
Mono<I> m = (Mono<I>)source;
return m;
}
if(source instanceof Fuseable){
return new MonoSourceFuseable<>(source);
}
Expand Down

0 comments on commit 5b9942b

Please sign in to comment.