Search in sources :

Example 1 with LockRequest

use of io.etcd.jetcd.api.lock.LockRequest in project jetcd by coreos.

the class LockImpl method lock.

@Override
public CompletableFuture<LockResponse> lock(ByteSequence name, long leaseId) {
    checkNotNull(name);
    LockRequest request = LockRequest.newBuilder().setName(Util.prefixNamespace(name, namespace)).setLease(leaseId).build();
    return execute(() -> stub.lock(request), response -> new LockResponse(response, namespace), Errors::isRetryable);
}
Also used : Errors(io.etcd.jetcd.support.Errors) LockResponse(io.etcd.jetcd.lock.LockResponse) LockRequest(io.etcd.jetcd.api.lock.LockRequest)

Aggregations

LockRequest (io.etcd.jetcd.api.lock.LockRequest)1 LockResponse (io.etcd.jetcd.lock.LockResponse)1 Errors (io.etcd.jetcd.support.Errors)1