Class: Curl::Multi
- Inherits:
-
Object
- Object
- Curl::Multi
- Defined in:
- lib/http/compat/curb.rb
Instance Method Summary collapse
- #add(client) ⇒ Object
-
#initialize ⇒ Multi
constructor
A new instance of Multi.
- #perform ⇒ Object
Constructor Details
#initialize ⇒ Multi
Returns a new instance of Multi.
67 68 69 70 |
# File 'lib/http/compat/curb.rb', line 67 def initialize @clients = [] @done = false end |
Instance Method Details
#add(client) ⇒ Object
72 73 74 |
# File 'lib/http/compat/curb.rb', line 72 def add(client) @clients << client end |
#perform ⇒ Object
77 78 79 80 81 82 83 84 85 |
# File 'lib/http/compat/curb.rb', line 77 def perform return if @done @clients.map do |client| Thread.new { client.perform } end.each(&:join) @done = true end |