Class: XRay::RulePoller

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/aws-xray-sdk/sampling/rule_poller.rb

Overview

Polls sampling rules from X-Ray service

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

#logger, logger, logger=

Constructor Details

#initialize(cache:, connector:) ⇒ RulePoller

Returns a new instance of RulePoller.



9
10
11
12
# File 'lib/aws-xray-sdk/sampling/rule_poller.rb', line 9

def initialize(cache:, connector:)
  @cache = cache
  @connector = connector
end

Instance Attribute Details

#cacheObject (readonly)

Returns the value of attribute cache.



7
8
9
# File 'lib/aws-xray-sdk/sampling/rule_poller.rb', line 7

def cache
  @cache
end

#connectorObject (readonly)

Returns the value of attribute connector.



7
8
9
# File 'lib/aws-xray-sdk/sampling/rule_poller.rb', line 7

def connector
  @connector
end

Instance Method Details

#runObject



14
15
16
17
18
19
# File 'lib/aws-xray-sdk/sampling/rule_poller.rb', line 14

def run
  @worker ||= begin 
    Thread.new { poll }
  end
  @worker.run
end