use of com.hazelcast.cp.internal.datastructures.semaphore.AcquireResult in project hazelcast by hazelcast.
the class AcquirePermitsOp method run.
@Override
public Object run(CPGroupId groupId, long commitIndex) {
SemaphoreService service = getService();
AcquireInvocationKey key = new AcquireInvocationKey(commitIndex, invocationUid, callerAddress, callId, getSemaphoreEndpoint(), permits);
AcquireResult result = service.acquirePermits(groupId, name, key, timeoutMs);
if (result.status() == WAIT_KEY_ADDED) {
return PostponedResponse.INSTANCE;
}
return result.status() == SUCCESSFUL;
}
Aggregations