Search in sources :

Example 1 with ClientPartitionCancellableDelegatingFuture

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

the class ClientExecutorServiceProxy method checkSync.

private <T> Future<T> checkSync(ClientInvocationFuture f, String uuid, int partitionId, 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 ClientPartitionCancellableDelegatingFuture<T>(f, getContext(), uuid, partitionId, defaultValue, SUBMIT_TO_PARTITION_DECODER);
    }
}
Also used : Executor(java.util.concurrent.Executor) CompletedFuture(com.hazelcast.util.executor.CompletedFuture) ClientPartitionCancellableDelegatingFuture(com.hazelcast.client.util.ClientPartitionCancellableDelegatingFuture)

Aggregations

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