Module: TraceView::Inst::CurlMultiIM

Defined in:
lib/traceview/inst/curb.rb

Overview

CurlMultiIM

This module contains the instance method wrappers for the CurlMulti class. This module should be included into CurlMulti.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



243
244
245
# File 'lib/traceview/inst/curb.rb', line 243

def self.included(klass)
  ::TraceView::Util.method_alias(klass, :perform, ::Curl::Multi)
end

Instance Method Details

#perform_with_traceview(&block) ⇒ Object

perform_with_traceview

::Curl::Multi.new.perform wrapper



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/traceview/inst/curb.rb', line 252

def perform_with_traceview(&block)
  # If we're not tracing or we're not already tracing curb, just do a fast return.
  if !TraceView.tracing? || [:curb, :curb_multi].include?(TraceView.layer)
    return perform_without_traceview(&block)
  end

  begin
    kvs = {}
    kvs[:Backtrace] = TraceView::API.backtrace if TraceView::Config[:curb][:collect_backtraces]

    TraceView::API.log_entry(:curb_multi, kvs)

    # The core curb call
    perform_without_traceview(&block)
  rescue => e
    TraceView::API.log_exception(:curb_multi, e)
    raise e
  ensure
    TraceView::API.log_exit(:curb_multi)
  end
end