reactor-core/src/main/java/reactor/core/publisher/FluxZip.java
void handleBoth(CoreSubscriber<? super R> s,
			Publisher<? extends T>[] srcs,
			@Nullable Object[] scalars,
			int n,
			int sc) {
		if (sc != 0 && scalars != null) {
			if (n != sc) {
				ZipSingleCoordinator<T, R> coordinator =
						new ZipSingleCoordinator<>(s, scalars, n, zipper);

				s.onSubscribe(coordinator);

				coordinator.subscribe(n, sc, srcs);
			}
			else {
				Operators.MonoSubscriber<R, R> sds = new Operators.MonoSubscriber<>(s);

				s.onSubscribe(sds);

				R r;

				try {
					r = Objects.requireNonNull(zipper.apply(scalars),
							"The zipper returned a null value");
				}
				catch (Throwable e) {
					s.onError(Operators.onOperatorError(e, s.currentContext()));
					return;
				}

				sds.complete(r);
			}

		}
		else {
			ZipCoordinator<T, R> coordinator =
					new ZipCoordinator<>(s, zipper, n, queueSupplier, prefetch);

			s.onSubscribe(coordinator);

			coordinator.subscribe(srcs, n);
		}
	}
void handleBoth(CoreSubscriber<? super R> s,
			Publisher<? extends T>[] srcs,
			@Nullable Object[] scalars,
			int n,
			int sc) {
		if (sc != 0 && scalars != null) {
			if (n != sc) {
				ZipSingleCoordinator<T, R> coordinator =
						new ZipSingleCoordinator<>(s, scalars, n, zipper);

				s.onSubscribe(coordinator);

				coordinator.subscribe(n, sc, srcs);
			}
			else {
				Operators.MonoSubscriber<R, R> sds = new Operators.MonoSubscriber<>(s);

				s.onSubscribe(sds);

				R r;

				try {
					r = Objects.requireNonNull(zipper.apply(scalars),
							"The zipper returned a null value");
				}
				catch (Throwable e) {
					s.onError(Operators.onOperatorError(e, s.currentContext()));
					return;
				}

				sds.complete(r);
			}

		}
		else {
			ZipCoordinator<T, R> coordinator =
					new ZipCoordinator<>(s, zipper, n, queueSupplier, prefetch);

			s.onSubscribe(coordinator);

			coordinator.subscribe(srcs, n);
		}
	}
void handleBoth ( CoreSubscriber < ? super R > s , Publisher < ? extends T > [ ] srcs , @ Nullable Object [ ] scalars , int n , int sc ) { if ( sc != 0 && scalars != null ) { if ( n != sc ) { ZipSingleCoordinator < T , R > coordinator = new ZipSingleCoordinator <> ( s , scalars , n , zipper ) ; s . onSubscribe ( coordinator ) ; coordinator . subscribe ( n , sc , srcs ) ; } else { Operators . MonoSubscriber < R , R > sds = new Operators . MonoSubscriber <> ( s ) ; s . onSubscribe ( sds ) ; R r ; try { r = Objects . requireNonNull ( zipper . apply ( scalars ) , "The zipper returned a null value" ) ; } catch ( Throwable e ) { s . onError ( Operators . onOperatorError ( e , s . currentContext ( ) ) ) ; return ; } sds . complete ( r ) ; } } else { ZipCoordinator < T , R > coordinator = new ZipCoordinator <> ( s , zipper , n , queueSupplier , prefetch ) ; s . onSubscribe ( coordinator ) ; coordinator . subscribe ( srcs , n ) ; } }
Handle values either from the iterable mode or array mode, taking into account the
possibility that some sources were already resolved (being {@link Callable}):

- if all sources have been resolved (sc == n), simply apply the mapper
- if some sources have been resolved (n > sc > 0), use a coordinator with the sparse
array, which will subscribe to unresolved sources only
- if no source is resolved, none was callable: use a coordinator without the sparse
array, resulting on an inner subscription for each source

@param s the subscriber
@param srcs the array of sources, some of which can be callable
@param scalars a sparse array of values resolved for the callable sources, null if not resolved
@param n the number of sources
@param sc the number of already resolved sources in the scalars array
Handle values either from the iterable mode or array mode taking into account the possibility that some sources were already resolved ( being { @link Callable } ) :