/** * Creates the wrapper by creating the delegate mono. * * @param callback Gets the wrapper around {@link reactor.core.publisher.MonoSink} which can be used to complete the * mono * @param <T> The type of data sent via this mono * @return instance of created wrapper */ public static <T> MonoWrapper<T> create(Consumer<MonoSinkWrapper<T>> callback) { return new MonoWrapper<>(Mono.create(monoSink -> callback.accept(new MonoSinkWrapper<>(monoSink)))); } }
/** * Creates the wrapper by creating the delegate mono. * * @param callback Gets the wrapper around {@link reactor.core.publisher.MonoSink} which can be used to complete the * mono * @param <T> The type of data sent via this mono * @return instance of created wrapper */ public static <T> MonoWrapper<T> create(Consumer<MonoSinkWrapper<T>> callback) { return new MonoWrapper<>(Mono.create(monoSink -> callback.accept(new MonoSinkWrapper<>(monoSink)))); } }
/** * Creates the wrapper by creating the delegate mono. * * @param callback Gets the wrapper around {@link reactor.core.publisher.MonoSink} which can be used to complete the * mono * @param <T> The type of data sent via this mono * @return instance of created wrapper */ public static <T> MonoWrapper<T> create(Consumer<MonoSinkWrapper<T>> callback) { return new MonoWrapper<>(Mono.create(monoSink -> callback.accept(new MonoSinkWrapper<>(monoSink)))); } }