Class: Koine::RestClient::AsyncQueue
- Inherits:
-
Object
- Object
- Koine::RestClient::AsyncQueue
- Defined in:
- lib/koine/rest_client/async_queue.rb
Overview
queue for async requests
Instance Method Summary collapse
- #clear ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ AsyncQueue
constructor
A new instance of AsyncQueue.
- #map ⇒ Object
- #push(item, &block) ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize ⇒ AsyncQueue
Returns a new instance of AsyncQueue.
7 8 9 |
# File 'lib/koine/rest_client/async_queue.rb', line 7 def initialize @items = [] end |
Instance Method Details
#clear ⇒ Object
27 28 29 |
# File 'lib/koine/rest_client/async_queue.rb', line 27 def clear @items.clear end |
#each ⇒ Object
15 16 17 18 19 |
# File 'lib/koine/rest_client/async_queue.rb', line 15 def each @items.each do |item| yield(item[0], item[1]) end end |
#map ⇒ Object
21 22 23 24 25 |
# File 'lib/koine/rest_client/async_queue.rb', line 21 def map @items.map do |item| yield(item[0], item[1]) end end |
#push(item, &block) ⇒ Object
11 12 13 |
# File 'lib/koine/rest_client/async_queue.rb', line 11 def push(item, &block) @items.push([item, block]) end |
#to_a ⇒ Object
31 32 33 |
# File 'lib/koine/rest_client/async_queue.rb', line 31 def to_a @items.to_a end |