def write_lock
      index = lock_modify_index.nil? ? 0 : lock_modify_index
      value = generate_lockfile
      return true if value == true
      Diplomat::Kv.put(@lock, value, cas: index)
    end
def write_lock
      index = lock_modify_index.nil? ? 0 : lock_modify_index
      value = generate_lockfile
      return true if value == true
      Diplomat::Kv.put(@lock, value, cas: index)
    end
Write a new lock file if the number of contenders is less than `limit`
 @return [Boolean] `true` if the lock was written succesfully