public class BackgroundTask extends Object implements BlockingTask
Modifier and Type | Class and Description |
---|---|
static class |
BackgroundTask.BackgroundTaskBuilder
A builder helper for building new background tasks
|
Modifier and Type | Method and Description |
---|---|
boolean |
run(BooleanSupplier supplier)
Run the task
|
<T> boolean |
run(Predicate<T> predicate,
T payload)
Run the task
|
public <T> boolean run(Predicate<T> predicate, T payload)
BlockingTask
run
in interface BlockingTask
T
- The type of the payload passed to the predicate when testing the taskpredicate
- the task as a predicate. The result of the predicate is used to check if the task has completed
or not. The predicate must return true if the execution has completed or false otherwise.
Failures on the task should be handled on the predicate using the payload as wrapper for In/Out
if necessarypayload
- a payload to be passed to the taskpublic boolean run(BooleanSupplier supplier)
BlockingTask
run
in interface BlockingTask
supplier
- the task as a boolean supplier. The result is used to check if the task has completed or not.
The supplier must return true if the execution has completed or false otherwise.Apache Camel