Method: Mongo::Server::ConnectionPool#wait_timeout

Defined in:
lib/mongo/server/connection_pool.rb

#wait_timeout(context = nil) ⇒ Float

The time to wait, in seconds, for a connection to become available.

Parameters:

  • context (Mongo::Operation:Context | nil) (defaults to: nil)

    Context of the operation the connection is requested for, if any.

Returns:

  • (Float)

    The queue wait timeout.

Since:

  • 2.9.0



214
215
216
217
218
219
220
# File 'lib/mongo/server/connection_pool.rb', line 214

def wait_timeout(context = nil)
  if context&.remaining_timeout_sec.nil?
    options[:wait_timeout] || DEFAULT_WAIT_TIMEOUT
  else
    context&.remaining_timeout_sec
  end
end