Package io.etcd.jetcd.api.lock
Class VertxLockGrpc.LockVertxImplBase
- java.lang.Object
-
- io.etcd.jetcd.api.lock.VertxLockGrpc.LockVertxImplBase
-
- All Implemented Interfaces:
io.grpc.BindableService
- Enclosing class:
- VertxLockGrpc
public abstract static class VertxLockGrpc.LockVertxImplBase extends java.lang.Object implements io.grpc.BindableServiceThe lock service exposes client-side locking facilities as a gRPC interface.
-
-
Constructor Summary
Constructors Constructor Description LockVertxImplBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.grpc.ServerServiceDefinitionbindService()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.VertxLockGrpc.LockVertxImplBasewithCompression(java.lang.String compression)Set whether the server will try to use a compressed response.
-
-
-
Method Detail
-
withCompression
public VertxLockGrpc.LockVertxImplBase withCompression(java.lang.String compression)
Set whether the server will try to use a compressed response.- Parameters:
compression- the compression, e.ggzip
-
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.
-
bindService
public final io.grpc.ServerServiceDefinition bindService()
- Specified by:
bindServicein interfaceio.grpc.BindableService
-
-