Package org.consensusj.jsonrpc
Interface AsyncSupport.TransientErrorFilter
- Enclosing interface:
AsyncSupport
public static interface AsyncSupport.TransientErrorFilter
Error filter for resilient polling. Uses a Predicate to specify what to ignore and a Consumer to log
what is ignored.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> CompletableFuture
<Optional<T>> Handler to transpose to a "future maybe".boolean
void
none()
-
Method Details
-
of
-
none
-
handle
Handler to transpose to a "future maybe". Use withCompletableFuture.handle(BiFunction)
followed by.thenCompose(Function.identity())
(or if JDK 12+CompletableFuture#exceptionallyCompose(Function)
) to swallow transient errors.- Type Parameters:
T
- The desired return type- Parameters:
result
- Tt
- An error, possibly transient- Returns:
- A completable future of future maybe
-
isTransient
-
log
-