reactor-core/src/main/java/reactor/core/publisher/OperatorDisposables.java
public static <T> boolean setOnce(AtomicReferenceFieldUpdater<T, Disposable> updater, T holder, Disposable newValue,
			Consumer<RuntimeException> errorCallback) {
		Objects.requireNonNull(newValue, "newValue is null");
		if (!updater.compareAndSet(holder, null, newValue)) {
			newValue.dispose();
			if (updater.get(holder) != DISPOSED) {
				errorCallback.accept(new IllegalStateException("Disposable already pushed"));
			}
			return false;
		}
		return true;
	}
public static <T> boolean setOnce(AtomicReferenceFieldUpdater<T, Disposable> updater, T holder, Disposable newValue,
			Consumer<RuntimeException> errorCallback) {
		Objects.requireNonNull(newValue, "newValue is null");
		if (!updater.compareAndSet(holder, null, newValue)) {
			newValue.dispose();
			if (updater.get(holder) != DISPOSED) {
				errorCallback.accept(new IllegalStateException("Disposable already pushed"));
			}
			return false;
		}
		return true;
	}
public static < T > boolean setOnce ( AtomicReferenceFieldUpdater < T , Disposable > updater , T holder , Disposable newValue , Consumer < RuntimeException > errorCallback ) { Objects . requireNonNull ( newValue , "newValue is null" ) ; if ( ! updater . compareAndSet ( holder , null , newValue ) ) { newValue . dispose ( ) ; if ( updater . get ( holder ) != DISPOSED ) { errorCallback . accept ( new IllegalStateException ( "Disposable already pushed" ) ) ; } return false ; } return true ; }
Atomically set the field to the given non-null {@link Disposable} and return true,
or return false if the field is non-null.
If the target field contains the common {@link #DISPOSED} instance, the supplied disposable
is disposed. If the field contains other non-null {@link Disposable}, an {@link IllegalStateException}
is signalled to the {@code errorCallback}.

@param updater the target field updater
@param holder the target instance holding the field
@param newValue the new Disposable to set, not null
@return true if the operation succeeded, false
Atomically set the field to the given non - null { @link Disposable } and return true or return false if the field is non - null . If the target field contains the common { @link #DISPOSED } instance the supplied disposable is disposed . If the field contains other non - null { @link Disposable } an { @link IllegalStateException } is signalled to the { @code errorCallback } .