Search in sources :

Example 1 with ClientAddressCancellableDelegatingFuture

use of com.hazelcast.client.util.ClientAddressCancellableDelegatingFuture in project hazelcast by hazelcast.

the class ClientExecutorServiceProxy method checkSync.

private <T> Future<T> checkSync(ClientInvocationFuture f, String uuid, Address address, boolean preventSync, T defaultValue) {
    boolean sync = isSyncComputation(preventSync);
    if (sync) {
        Object response = retrieveResultFromMessage(f);
        Executor userExecutor = getContext().getExecutionService().getUserExecutor();
        return new CompletedFuture<T>(getContext().getSerializationService(), response, userExecutor);
    } else {
        return new ClientAddressCancellableDelegatingFuture<T>(f, getContext(), uuid, address, defaultValue, SUBMIT_TO_ADDRESS_DECODER);
    }
}
Also used : Executor(java.util.concurrent.Executor) ClientAddressCancellableDelegatingFuture(com.hazelcast.client.util.ClientAddressCancellableDelegatingFuture) CompletedFuture(com.hazelcast.util.executor.CompletedFuture)

Aggregations

ClientAddressCancellableDelegatingFuture (com.hazelcast.client.util.ClientAddressCancellableDelegatingFuture)1 CompletedFuture (com.hazelcast.util.executor.CompletedFuture)1 Executor (java.util.concurrent.Executor)1