Class: Contrast::Agent::Thread

Inherits:
Thread show all
Includes:
Components::Interface
Defined in:
lib/contrast/agent/thread.rb

Overview

Threads used by Contrast.

Instance Method Summary collapse

Methods included from Components::Interface

included

Methods inherited from Thread

#cs__initialize

Constructor Details

#initialize(*args) ⇒ Thread

Make our internal code run in Contrast scope.



15
16
17
18
19
20
21
22
23
# File 'lib/contrast/agent/thread.rb', line 15

def initialize *args
  wrapped_block = proc do |block_args|
    with_contrast_scope do
      yield(*block_args)
    end
  end

  super(*args, &wrapped_block)
end