Class RunnablePromise<T>
java.lang.Object
org.smallibs.concurrent.promise.impl.SolvablePromise<T>
org.smallibs.concurrent.promise.impl.RunnablePromise<T>
- All Implemented Interfaces:
Runnable,Promise<T>,Filter<Promise,,T, Promise<T>> HK<Promise,T, Promise<T>>
-
Field Summary
Fields inherited from interface org.smallibs.concurrent.promise.Promise
MAX_AWAIT_DURATION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal <R> Promise<R> biMap(FunctionWithError<? super T, ? extends R> onSuccess, FunctionWithError<? super Throwable, ? extends R> onError) Method used to map a function on success and another one on error.protected SolvableFuture<T> createFuture(java.util.function.Consumer<Try<T>> callbackOnComplete) Method called when the current data must be filtered using a given predicate.final <R> Promise<R> Method used to flatmap a function.final <R> Promise<R> map(FunctionWithError<? super T, ? extends R> function) Method used to map a function.voidrun()self()Methods inherited from class org.smallibs.concurrent.promise.impl.SolvablePromise
await, await, getFuture, onComplete, onFailure, onSuccess, solve
-
Constructor Details
-
RunnablePromise
-
-
Method Details
-
run
public void run() -
createFuture
- Overrides:
createFuturein classSolvablePromise<T>
-
map
Description copied from interface:PromiseMethod used to map a function. This mapping is done when the operation is a success. The result of this mapping is a new promise component. -
biMap
public final <R> Promise<R> biMap(FunctionWithError<? super T, ? extends R> onSuccess, FunctionWithError<? super Throwable, ? extends R> onError) Description copied from interface:PromiseMethod used to map a function on success and another one on error. The result of this mapping is a new promise component. -
flatmap
Description copied from interface:PromiseMethod used to flatmap a function. This mapping is done when the operation is a success. The result of this mapping is a new promise component. -
filter
Description copied from interface:FilterMethod called when the current data must be filtered using a given predicate. -
self
-