public static class CoroutineScope.ScopeFuture<T>
extends java.lang.Object
implements java.util.concurrent.Future<T>
Constructor and Description |
---|
ScopeFuture(CoroutineScope rScope,
java.util.function.Function<? super CoroutineScope,T> fGetResult,
CoroutineScope.ScopeCode rCode)
Creates a new instance for a certain scope.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean rMayInterruptIfRunning) |
T |
get() |
T |
get(long nTimeout,
java.util.concurrent.TimeUnit eUnit) |
boolean |
isCancelled() |
boolean |
isDone() |
public ScopeFuture(CoroutineScope rScope, java.util.function.Function<? super CoroutineScope,T> fGetResult, CoroutineScope.ScopeCode rCode)
rScope
- The scope to await for the resultfGetResult
- A function that retrieves the result from the scope
or NULL to always return NULLrCode
- The code to be executed in the scopepublic boolean cancel(boolean rMayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future<T>
public T get(long nTimeout, java.util.concurrent.TimeUnit eUnit)
get
in interface java.util.concurrent.Future<T>
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<T>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<T>