api::v1::meta::lock_server

Trait Lock

pub trait Lock:
    Send
    + Sync
    + 'static {
    // Required methods
    fn lock<'life0, 'async_trait>(
        &'life0 self,
        request: Request<LockRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<LockResponse>, Status>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn unlock<'life0, 'async_trait>(
        &'life0 self,
        request: Request<UnlockRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<UnlockResponse>, Status>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with LockServer.

Required Methods§

fn lock<'life0, 'async_trait>( &'life0 self, request: Request<LockRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<LockResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

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.

fn unlock<'life0, 'async_trait>( &'life0 self, request: Request<UnlockRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UnlockResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Unlock takes a key returned by Lock and releases the hold on lock.

Implementors§