Package io.etcd.jetcd.api.lock
Class VertxLockGrpc.LockVertxStub
- java.lang.Object
-
- io.grpc.stub.AbstractStub<VertxLockGrpc.LockVertxStub>
-
- io.etcd.jetcd.api.lock.VertxLockGrpc.LockVertxStub
-
- Enclosing class:
- VertxLockGrpc
public static final class VertxLockGrpc.LockVertxStub extends io.grpc.stub.AbstractStub<VertxLockGrpc.LockVertxStub>
The lock service exposes client-side locking facilities as a gRPC interface.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected VertxLockGrpc.LockVertxStubbuild(io.grpc.Channel channel, io.grpc.CallOptions callOptions)io.vertx.core.Future<LockResponse>lock(LockRequest request)Lock acquires a distributed shared lock on a given named lock.io.vertx.core.Future<UnlockResponse>unlock(UnlockRequest request)Unlock takes a key returned by Lock and releases the hold on lock.-
Methods inherited from class io.grpc.stub.AbstractStub
getCallOptions, getChannel, newStub, newStub, withCallCredentials, withChannel, withCompression, withDeadline, withDeadlineAfter, withExecutor, withInterceptors, withMaxInboundMessageSize, withMaxOutboundMessageSize, withOption, withWaitForReady
-
-
-
-
Method Detail
-
build
protected VertxLockGrpc.LockVertxStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)
- Specified by:
buildin classio.grpc.stub.AbstractStub<VertxLockGrpc.LockVertxStub>
-
lock
public io.vertx.core.Future<LockResponse> lock(LockRequest request)
Lock acquires a distributed shared lock on a given named lock. On success, it will return a unique key that exists so long as the lock is held by the caller. This key can be used in conjunction with transactions to safely ensure updates to etcd only occur while holding lock ownership. The lock is held until Unlock is called on the key or the lease associate with the owner expires.
-
unlock
public io.vertx.core.Future<UnlockResponse> unlock(UnlockRequest request)
Unlock takes a key returned by Lock and releases the hold on lock. The next Lock caller waiting for the lock will then be woken up and given ownership of the lock.
-
-