def group(timeout: nil)
      group = nil
      monitor do |condition|
        group = RequestGroup.new(self, condition)
        yield group
        if !group.empty? && exception = condition.wait(timeout || DEFAULT_GROUP_TIMEOUT)
          raise exception
        end
      end
    ensure
      group.terminate
    end
def group(timeout: nil)
      group = nil
      monitor do |condition|
        group = RequestGroup.new(self, condition)
        yield group
        if !group.empty? && exception = condition.wait(timeout || DEFAULT_GROUP_TIMEOUT)
          raise exception
        end
      end
    ensure
      group.terminate
    end
Use this to group a batch of requests and halt the caller thread until all of the requests in the group have been
 performed.

 It proxies {RequestGroup#send_notification} to {Client#send_notification}, but, unlike the latter, the request
 callbacks are provided in the form of a block.

 @note   Do **not** share the yielded group across threads.

 @see    RequestGroup#send_notification
 @see    Connection::Monitor

 @param  [Numeric] timeout
         the maximum amount of time to wait for a request group to halt the caller thread. Defaults to 1 hour.

 @yieldparam [RequestGroup] group
         the request group object.

 @raise  [Exception]
         if a connection in the pool has died during the execution of this group, the reason for its death will be
         raised.

 @return [void]