reactor-core/src/main/java/reactor/core/publisher/Mono.java
public static <T, D> Mono<T> using(Callable<? extends D> resourceSupplier,
			Function<? super D, ? extends Mono<? extends T>> sourceSupplier,
			Consumer<? super D> resourceCleanup,
			boolean eager) {
		return onAssembly(new MonoUsing<>(resourceSupplier, sourceSupplier,
				resourceCleanup, eager));
	}
public static <T, D> Mono<T> using(Callable<? extends D> resourceSupplier,
			Function<? super D, ? extends Mono<? extends T>> sourceSupplier,
			Consumer<? super D> resourceCleanup,
			boolean eager) {
		return onAssembly(new MonoUsing<>(resourceSupplier, sourceSupplier,
				resourceCleanup, eager));
	}
public static < T , D > Mono < T > using ( Callable < ? extends D > resourceSupplier , Function < ? super D , ? extends Mono < ? extends T > > sourceSupplier , Consumer < ? super D > resourceCleanup , boolean eager ) { return onAssembly ( new MonoUsing <> ( resourceSupplier , sourceSupplier , resourceCleanup , eager ) ) ; }
Uses a resource, generated by a supplier for each individual Subscriber, while streaming the value from a
Mono derived from the same resource and makes sure the resource is released if the
sequence terminates or the Subscriber cancels.
<p>
<ul> <li>Eager resource cleanup happens just before the source termination and exceptions raised by the cleanup
Consumer may override the terminal event.</li> <li>Non-eager cleanup will drop any exception.</li> </ul>
<p>
<img class="marble" src="doc-files/marbles/usingForMono.svg" alt="">

@param resourceSupplier a {@link Callable} that is called on subscribe to create the resource
@param sourceSupplier a {@link Mono} factory to create the Mono depending on the created resource
@param resourceCleanup invoked on completion to clean-up the resource
@param eager set to true to clean before terminating downstream subscribers
@param <T> emitted type
@param <D> resource type

@return new {@link Mono}
Uses a resource generated by a supplier for each individual Subscriber while streaming the value from a Mono derived from the same resource and makes sure the resource is released if the sequence terminates or the Subscriber cancels . <p > <ul > <li > Eager resource cleanup happens just before the source termination and exceptions raised by the cleanup Consumer may override the terminal event . < / li > <li > Non - eager cleanup will drop any exception . < / li > < / ul > <p > <img class = marble src = doc - files / marbles / usingForMono . svg alt = >