Package lu.kbra.pclib.async
Class NextTask<F,I,O>
java.lang.Object
lu.kbra.pclib.async.NextTask<F,I,O>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ThrowingConsumer<Throwable, Throwable> protected static final intprotected static final intprotected static final ExecutorServiceprotected static final intprotected static final intprotected final NextTask.NextTaskStatusprotected ThrowingFunction<I, O, Throwable> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchain(ThrowingFunction<O, O, Throwable>... tasks) last output + all the new oneslast output + all the new oneslast output + all the new onescollectSuppliers(List<ThrowingSupplier<O, Throwable>> tasks) collectSuppliers(Stream<ThrowingSupplier<O, Throwable>> stream) collectSuppliers(ThrowingSupplier<O, Throwable>... tasks) create(ThrowingFunction<Void, O, Throwable> task) create(ThrowingRunnable<Throwable> task) create(ThrowingSupplier<O, Throwable> task) empty()protected <X> Class<?> getFirstType(NextTask<X, ?, ?> task) protected <X> booleanhasVoidFirstType(NextTask<X, ?, ?> composed) orElseThrow(Throwable throw_) orElseThrow(ThrowingSupplier<Throwable, Throwable> throw_) protected voidquiet()run()runAsync()runAsync(F input, ExecutorService exec) runAsync(ExecutorService exec) runThrow()thenApply(ThrowingFunction<O, N, Throwable> nextFunction) thenCompose(NextTask<O, ?, N> nextTask) thenCompose(ThrowingFunction<O, NextTask<X, ?, N>, Throwable> nextTaskFunction) thenCompose(ThrowingSupplier<NextTask<X, ?, N>, Throwable> nextTaskFunction) thenConsume(ThrowingConsumer<O, Throwable> consumer) thenParallel(ThrowingConsumer<O, Throwable> nextFunction) withArg(ThrowingConsumer<I, Throwable> task) static <I,O> NextTask <I, I, O> withArg(ThrowingFunction<I, O, Throwable> task)
-
Field Details
-
EXECUTOR
-
IDLE
protected static final int IDLE- See Also:
-
RUNNING
protected static final int RUNNING- See Also:
-
DONE
protected static final int DONE- See Also:
-
ERROR
protected static final int ERROR- See Also:
-
first
-
next
-
catcher
-
task
-
-
Constructor Details
-
NextTask
-
-
Method Details
-
chain
@SafeVarargs public static <O> NextTask<O,O, chainList<O>> (ThrowingFunction<O, O, Throwable>... tasks) -
collect
-
collect
-
collect
-
collector
last output + all the new ones -
collector
last output + all the new ones -
collector
last output + all the new ones -
collectSuppliers
-
collectSuppliers
-
collectSuppliers
@SafeVarargs public static <O> NextTask<Void,Void, collectSuppliersList<O>> (ThrowingSupplier<O, Throwable>... tasks) -
create
-
create
-
create
-
empty
-
parallel
-
parallel
-
parallel
-
withArg
-
withArg
-
catch_
-
getTaskState
-
orElse
-
orElse
-
orElse
-
orElseThrow
-
orElseThrow
-
quiet
-
run
-
run
-
runAsync
-
runAsync
-
runAsync
-
runAsync
-
runThrow
- Throws:
Throwable
-
runThrow
- Throws:
Throwable
-
thenApply
-
thenCompose
-
thenCompose
-
thenCompose
-
thenConsume
-
thenParallel
-
toOptional
-
getFirstType
-
hasVoidFirstType
-
propagateException
- Throws:
Throwable
-