public interface MainThreadExecutable
Runnable
and Callable
in the main thread of the underlying
RPC endpoint.
This interface is intended to be implemented by the self gateway in a RpcEndpoint
implementation which allows to dispatch local procedures to the main thread of the underlying
RPC endpoint.
Modifier and Type | Method and Description |
---|---|
<V> CompletableFuture<V> |
callAsync(Callable<V> callable,
Time callTimeout)
Execute the callable in the main thread of the underlying RPC endpoint and return a future for
the callable result.
|
void |
runAsync(Runnable runnable)
Execute the runnable in the main thread of the underlying RPC endpoint.
|
void |
scheduleRunAsync(Runnable runnable,
long delay)
Execute the runnable in the main thread of the underlying RPC endpoint, with
a delay of the given number of milliseconds.
|
void runAsync(Runnable runnable)
runnable
- Runnable to be executed<V> CompletableFuture<V> callAsync(Callable<V> callable, Time callTimeout)
TimeoutException
.V
- Return value of the callablecallable
- Callable to be executedcallTimeout
- Timeout for the future to completevoid scheduleRunAsync(Runnable runnable, long delay)
runnable
- Runnable to be executeddelay
- The delay, in milliseconds, after which the runnable will be executedCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.