static < T > Mono < T > convertToMono ( Callable < T > supplier ) { if ( supplier instanceof Fuseable . ScalarCallable ) { Fuseable . ScalarCallable < T > scalarCallable = ( Fuseable . ScalarCallable < T > ) supplier ; T v ; try { v = scalarCallable . call ( ) ; } catch ( Exception e ) { return Mono . error ( e ) ; } if ( v == null ) { return Mono . empty ( ) ; } return Mono . just ( v ) ; } return Mono . onAssembly ( new MonoCallable <> ( supplier ) ) ; }
Returns the appropriate Mono instance for a known Supplier Flux .