Package org.cometd.common
Interface AsyncFoldLeft.Loop<R>
-
- Type Parameters:
R
- the type of the result
- Enclosing class:
- AsyncFoldLeft
public static interface AsyncFoldLeft.Loop<R>
Controls the iteration over a sequence of elements, allowing to continue the iteration (with a result), break out of the iteration (with a result), or fail the iteration (with an exception).
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
fail(java.lang.Throwable failure)
Makes the loop fail (similarly to throwing an exception).default void
leave(R r)
Makes the loop exit (similarly to thebreak
statement).default void
proceed(R r)
Makes the loop proceed to the next element (or the end of the loop).
-
-
-
Method Detail
-
proceed
default void proceed(R r)
Makes the loop proceed to the next element (or the end of the loop).
- Parameters:
r
- the result computed in the current iteration
-
leave
default void leave(R r)
Makes the loop exit (similarly to the
break
statement).- Parameters:
r
- the result computed in the current iteration
-
fail
default void fail(java.lang.Throwable failure)
Makes the loop fail (similarly to throwing an exception).
- Parameters:
failure
- the failure of the current iteration
-
-