operator/src/main/java/oracle/kubernetes/operator/work/Step.java
protected NextAction doForkJoin(
      Step step, Packet packet, Collection<StepAndPacket> startDetails) {
    return doSuspend(
        step,
        (fiber) -> {
          CompletionCallback callback =
              new JoinCompletionCallback(fiber, packet, startDetails.size()) {
                @Override
                public void onCompletion(Packet p) {
                  int current = count.decrementAndGet();
                  if (current == 0) {
                    // no need to synchronize throwables as all fibers are done
                    if (throwables.isEmpty()) {
                      fiber.resume(packet);
                    } else if (throwables.size() == 1) {
                      fiber.terminate(throwables.get(0), packet);
                    } else {
                      fiber.terminate(new MultiThrowable(throwables), packet);
                    }
                  }
                }
              };
          // start forked fibers
          for (StepAndPacket sp : startDetails) {
            fiber.createChildFiber().start(sp.step, sp.packet, callback);
          }
        });
  }
/**
   * Create a {@link NextAction} that suspends the current {@link Fiber} and that starts child
   * fibers for each step and packet pair. When all of the created child fibers complete, then this
   * fiber is resumed with the indicated step and packet.
   *
   * @param step Step to invoke next when resumed after child fibers complete
   * @param packet Resume packet
   * @param startDetails Pairs of step and packet to use when starting child fibers
   * @return Next action
   */
Create a  NextAction that suspends the current  Fiber and that starts child
fibers for each step and packet pair. When all of the created child fibers complete, then this
fiber is resumed with the indicated step and packet.

@param step Step to invoke next when resumed after child fibers complete
@param packet Resume packet
@param startDetails Pairs of step and packet to use when starting child fibers
@return Next action
Create a NextAction that suspends the current Fiber and that starts child fibers for each step and packet pair . When all of the created child fibers complete then this fiber is resumed with the indicated step and packet . @param step Step to invoke next when resumed after child fibers complete @param packet Resume packet @param startDetails Pairs of step and packet to use when starting child fibers @return Next action
protected NextAction doForkJoin(
      Step step, Packet packet, Collection<StepAndPacket> startDetails) {
    return doSuspend(
        step,
        (fiber) -> {
          CompletionCallback callback =
              new JoinCompletionCallback(fiber, packet, startDetails.size()) {
                @Override
                public void onCompletion(Packet p) {
                  int current = count.decrementAndGet();
                  if (current == 0) {
                    if (throwables.isEmpty()) {
                      fiber.resume(packet);
                    } else if (throwables.size() == 1) {
                      fiber.terminate(throwables.get(0), packet);
                    } else {
                      fiber.terminate(new MultiThrowable(throwables), packet);
                    }
                  }
                }
              };
          for (StepAndPacket sp : startDetails) {
            fiber.createChildFiber().start(sp.step, sp.packet, callback);
          }
        });
  }
protected NextAction doForkJoin ( Step step , Packet packet , Collection < StepAndPacket > startDetails ) { return doSuspend ( step , ( fiber ) -> { CompletionCallback callback = new JoinCompletionCallback ( fiber , packet , startDetails . size ( ) ) { @ Override public void onCompletion ( Packet p ) { int current = count . decrementAndGet ( ) ; if ( current == 0 ) { if ( throwables . isEmpty ( ) ) { fiber . resume ( packet ) ; } else if ( throwables . size ( ) == 1 ) { fiber . terminate ( throwables . get ( 0 ) , packet ) ; } else { fiber . terminate ( new MultiThrowable ( throwables ) , packet ) ; } } } } ; for ( StepAndPacket sp : startDetails ) { fiber . createChildFiber ( ) . start ( sp . step , sp . packet , callback ) ; } } ) ; }
Create a {@link NextAction} that suspends the current {@link Fiber} and that starts child
 fibers for each step and packet pair.
Create a { @link NextAction } that suspends the current { @link Fiber } and that starts child fibers for each step and packet pair .
// no need to synchronize throwables as all fibers are done // start forked fibers