Ruby Language Queue Pulling Data from a Queue - #pop


Example

q = Queue.new
q << :data
q.pop #=> :data
  • #pop will block until there is some data available.
  • #pop can be used for synchronization.