Class: Ethon::Multi
- Inherits:
-
Object
- Object
- Ethon::Multi
- Includes:
- Operations, Options, Stack
- Defined in:
- lib/ethon/multi.rb,
lib/ethon/multi/stack.rb,
lib/ethon/multi/options.rb,
lib/ethon/multi/operations.rb
Overview
:nodoc
Defined Under Namespace
Modules: Operations, Options, Stack
Constant Summary
Constants included from Operations
Operations::PERFORMED_MULTI, Operations::STARTED_MULTI
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Multi
constructor
Create a new multi.
-
#set_attributes(options) ⇒ Object
private
Set given options.
Methods included from Options
#max_total_connections=, #maxconnects=, #pipelining=, #socketdata=, #socketfunction=, #timerdata=, #timerfunction=
Methods included from Operations
#handle, #init_vars, #perform, #prepare
Methods included from Stack
Constructor Details
#initialize(options = {}) ⇒ Multi
Create a new multi. Initialize curl in case it didn’t happen before.
Pass a long. The set number will be used as the maximum amount of simultaneously open connections in total. For each new session, libcurl will open a new connection up to the limit set by CURLMOPT_MAX_TOTAL_CONNECTIONS. When the limit is reached, the sessions will be pending until there are available connections. If CURLMOPT_PIPELINING is 1, libcurl will try to pipeline if the host is capable of it. The default value is 0, which means that there is no limit. However, for backwards compatibility, setting it to 0 when CURLMOPT_PIPELINING is 1 will not be treated as unlimited. Instead it will open only 1 connection and try to pipeline on it. (Added in 7.30.0)
78 79 80 81 82 |
# File 'lib/ethon/multi.rb', line 78 def initialize( = {}) Curl.init set_attributes() init_vars end |
Instance Method Details
#set_attributes(options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set given options.
94 95 96 97 98 99 100 101 |
# File 'lib/ethon/multi.rb', line 94 def set_attributes() .each_pair do |key, value| unless respond_to?("#{key}=") raise Errors::InvalidOption.new(key) end method("#{key}=").call(value) end end |