class ConnectionPool::TimedStack
def pop(timeout = 0.5, options = {})
Experimental RBS support (using type sampling data from the type_fusion
project).
def pop: (?Integer timeout, ?Hash options) -> untyped
This signature was generated using 4 samples from 1 application.
def pop(timeout = 0.5, options = {}) options, timeout = timeout, 0.5 if Hash === timeout timeout = options.fetch :timeout, timeout deadline = current_time + timeout @mutex.synchronize do loop do raise ConnectionPool::PoolShuttingDownError if @shutdown_block return fetch_connection(options) if connection_stored?(options) connection = try_create(options) return connection if connection to_wait = deadline - current_time raise ConnectionPool::TimeoutError, "Waited #{timeout} sec, #{length}/#{@max} available" if to_wait <= 0 @resource.wait(@mutex, to_wait) end end end