Class ImmediateFuture<T>
java.lang.Object
ch.raffael.meldioc.util.concurrent.ImmediateFuture<T>
- All Implemented Interfaces:
Future<T>
A
Future implementation that's run immediately in the
constructing thread. Instances of this are always completed.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel(boolean mayInterruptIfRunning) static <T> ImmediateFuture.Cancelled<T>get()booleanbooleanisDone()static <T> ImmediateFuture<T>of(io.vavr.CheckedFunction0<T> supplier) static <T> ImmediateFuture<T>of(io.vavr.control.Try<T> result) static <T> ImmediateFuture<T>ofCallable(Callable<T> callable) io.vavr.control.Try<T>result()static ImmediateFuture<Void>run(io.vavr.CheckedRunnable runnable) static ImmediateFuture<Void>runRunnable(Runnable runnable) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Method Details
-
of
-
of
-
run
-
runRunnable
-
ofCallable
-
cancelled
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
public boolean isDone() -
get
- Specified by:
getin interfaceFuture<T>- Throws:
ExecutionException
-
get
- Specified by:
getin interfaceFuture<T>- Throws:
ExecutionException
-
result
-