class ChefCLI::ChefServerAPIMulti
constructor.
disable them, ‘keepalives: false` must be set in the options to the
It also configures `Chef::ServerAPI` to enable keepalives by default. To
individually.
where the API of the Chef Infra Server requires each file to be downloaded
This is intended to be used for downloading cookbooks from the Chef Infa Server,
`Chef::ServerAPI` object per-thread.
A wrapper for `Chef::ServerAPI` that supports multi-threading by creating a
def client_for_thread
def client_for_thread Thread.current[:chef_server_api_multi] ||= Chef::ServerAPI.new(@url, @opts) end
def delete(*args)
def delete(*args) client_for_thread.delete(*args) end
def get(*args)
def get(*args) client_for_thread.get(*args) end
def head(*args)
def head(*args) client_for_thread.head(*args) end
def initialize(url, opts)
def initialize(url, opts) @url = url @opts = KEEPALIVES_TRUE.merge(opts) end
def post(*args)
def post(*args) client_for_thread.post(*args) end
def put(*args)
def put(*args) client_for_thread.put(*args) end
def streaming_request(*args, &block)
def streaming_request(*args, &block) client_for_thread.streaming_request(*args, &block) end