public final class RetryExecutor extends Object implements AutoCloseable
Constructor and Description |
---|
RetryExecutor(ExecutorService exec) |
RetryExecutor(ExecutorService exec,
BlockingQueue<Future<?>> completionQueue) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
<A,C extends Callable<? extends A>> |
execute(C command,
RetryPredicate<A,C> predicate) |
void |
execute(Runnable command,
RetryPredicate<Void,Callable<Void>> predicate) |
void |
initiateClose() |
<A,C extends Callable<? extends A>> |
submit(C task,
RetryPredicate<A,C> predicate) |
<A> Future<A> |
submit(Runnable task,
A result,
RetryPredicate<A,? extends Callable<? extends A>> predicate) |
Future<?> |
submit(Runnable task,
RetryPredicate<Void,Callable<Void>> predicate) |
String |
toString() |
public RetryExecutor(ExecutorService exec)
public RetryExecutor(ExecutorService exec, @Nullable BlockingQueue<Future<?>> completionQueue)
public void close() throws InterruptedException
close
in interface AutoCloseable
InterruptedException
public void initiateClose()
public <A,C extends Callable<? extends A>> Future<A> submit(C task, RetryPredicate<A,C> predicate)
public <A> Future<A> submit(Runnable task, A result, RetryPredicate<A,? extends Callable<? extends A>> predicate)
public void execute(Runnable command, RetryPredicate<Void,Callable<Void>> predicate)
public <A,C extends Callable<? extends A>> void execute(C command, RetryPredicate<A,C> predicate)
Copyright © 2018 SPF4J. All rights reserved.