instance method
poll
Ruby on Rails 8.0.4
Since v4.0.13Signature
poll(timeout = nil)
Remove the head of the queue.
If timeout is not given, remove and return the head of the queue if the number of available elements is strictly greater than the number of threads currently waiting (that is, don’t jump ahead in line). Otherwise, return nil.
If timeout is given, block if there is no element available, waiting up to timeout seconds for an element to become available.
Raises:
-
ActiveRecord::ConnectionTimeoutError if
timeoutis given and no element
becomes available within timeout seconds,
Parameters
-
timeoutopt = nil
Source
# File activerecord/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb, line 71
def poll(timeout = nil)
synchronize { internal_poll(timeout) }
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb line 71
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::ConnectionPool::Queue