Method: Etcdv3#lock

Defined in:
lib/etcdv3.rb

#lock(name, lease_id, timeout: nil) ⇒ Object

Locks distributed lock with the given name. The lock will unlock automatically when lease with the given ID expires. If this is not desirable, provide a non-expiring lease ID as an argument. name - string lease_id - integer optional :timeout - integer



109
110
111
# File 'lib/etcdv3.rb', line 109

def lock(name, lease_id, timeout: nil)
  @conn.handle(:lock, 'lock', [name, lease_id, {timeout: timeout}])
end