Package ch.tocco.nice2.tasks.api.quartz
Class CancelAwareIterators
java.lang.Object
ch.tocco.nice2.tasks.api.quartz.CancelAwareIterators
Iterators that can be used to handle cancellation in
AbstractInterruptableJob
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A> Iterable
<A> errorOnCancel
(AbstractInterruptableJob job, A... elements) Return a new `Iterable` that delegates to the given one.static <A> Iterable
<A> errorOnCancel
(AbstractInterruptableJob job, Iterable<A> iterable) Return a new `Iterable` that delegates to the given one.static <A> Iterable
<A> stopOnCancel
(AbstractInterruptableJob job, A... elements) Return a new `Iterable` that delegates to the given one.static <A> Iterable
<A> stopOnCancel
(AbstractInterruptableJob job, Iterable<A> iterable) Return a new `Iterable` that delegates to the given one.
-
Method Details
-
stopOnCancel
Return a new `Iterable` that delegates to the given one. On each next element, the `context` is checked whether the user cancelled the running action. If cancelled, the iterable changes to be exhausted. -
stopOnCancel
Return a new `Iterable` that delegates to the given one. On each next element, the `context` is checked whether the user cancelled the running action. If cancelled, the iterable changes to be exhausted. -
errorOnCancel
Return a new `Iterable` that delegates to the given one. On each next element access, the `context` is checked whether the user has cancelled the running action. If cancelled, the iterable throws an Exception. -
errorOnCancel
Return a new `Iterable` that delegates to the given one. On each next element access, the `context` is checked whether the user has cancelled the running action. If cancelled, the iterable throws an Exception.
-