public static class FluentFunctions.FluentRunnable<R> extends java.lang.Object implements Effect
| Constructor and Description |
|---|
FluentRunnable(java.lang.Runnable fn) |
| Modifier and Type | Method and Description |
|---|---|
FluentFunctions.FluentRunnable |
after(java.lang.Runnable action)
Apply after advice to this Supplier
|
FluentFunctions.FluentRunnable |
around(java.util.function.Function<FluentFunctions.Advice0<java.lang.Void>,java.lang.Void> around)
Apply around advice to this Supplier
|
FluentFunctions.FluentRunnable<R> |
before(java.lang.Runnable r)
Apply before advice to this Supplier
|
FluentFunctions.FluentRunnable |
log(java.util.function.Consumer<java.lang.String> logger,
java.util.function.Consumer<java.lang.Throwable> error)
A supplier that logs it's success or error states to the provided Consumers
|
FluentFunctions.FluentRunnable |
memoize() |
FluentFunctions.FluentRunnable |
name(java.lang.String name) |
FluentFunctions.FluentRunnable |
println() |
<X extends java.lang.Throwable> |
recover(java.lang.Class<X> type,
java.util.function.Supplier<R> onError)
A supplier that can recover from the specified exception types, using the provided Supplier
|
FluentFunctions.FluentRunnable |
retry(int times,
int backoffStartTime)
A supplier capable of retrying on failure using an exponential backoff strategy
|
void |
run() |
void |
runChecked() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitandThen, andThenChecked, async, asyncAndBlock, callable, compose, composeChecked, cycle, cycle, cycleAsync, cycleAsync, cycleForever, cycleUntil, cycleUntilException, cycleWhile, flatMap, fluentRunnable, forEach2, forEach3, forEach4, future, noop, onError, retry, retry, runAsync, supply, supplyOr, visitpublic FluentFunctions.FluentRunnable<R> before(java.lang.Runnable r)
r - Runnable that represents before advice (AOP)public FluentFunctions.FluentRunnable after(java.lang.Runnable action)
action - Runnable that represents after advice (AOP)public FluentFunctions.FluentRunnable around(java.util.function.Function<FluentFunctions.Advice0<java.lang.Void>,java.lang.Void> around)
around - Function that captures input to this Supplier and can optionally pass on the callpublic FluentFunctions.FluentRunnable memoize()
public FluentFunctions.FluentRunnable name(java.lang.String name)
name - To give this supplierpublic FluentFunctions.FluentRunnable println()
public FluentFunctions.FluentRunnable log(java.util.function.Consumer<java.lang.String> logger, java.util.function.Consumer<java.lang.Throwable> error)
logger - Success loggererror - Failure loggerpublic <X extends java.lang.Throwable> FluentFunctions.FluentRunnable recover(java.lang.Class<X> type, java.util.function.Supplier<R> onError)
type - Recoverable exception typesonError - Supplier to use on errorpublic FluentFunctions.FluentRunnable retry(int times, int backoffStartTime)
times - Number of times to retrybackoffStartTime - Wait time before first retrypublic void run()
public void runChecked()
throws java.lang.Exception
runChecked in interface Effectjava.lang.Exception