Class: Qs::PayloadHandler
- Inherits:
-
Object
- Object
- Qs::PayloadHandler
- Defined in:
- lib/qs/payload_handler.rb
Defined Under Namespace
Modules: RoundedTime, SummaryLine
Instance Attribute Summary collapse
-
#daemon_data ⇒ Object
readonly
Returns the value of attribute daemon_data.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#redis_item ⇒ Object
readonly
Returns the value of attribute redis_item.
Instance Method Summary collapse
-
#initialize(daemon_data, redis_item) ⇒ PayloadHandler
constructor
A new instance of PayloadHandler.
- #run ⇒ Object
Constructor Details
#initialize(daemon_data, redis_item) ⇒ PayloadHandler
Returns a new instance of PayloadHandler.
14 15 16 17 18 19 20 21 |
# File 'lib/qs/payload_handler.rb', line 14 def initialize(daemon_data, redis_item) @daemon_data = daemon_data @redis_item = redis_item @logger = Qs::Logger.new( @daemon_data.logger, @daemon_data.verbose_logging ) end |
Instance Attribute Details
#daemon_data ⇒ Object (readonly)
Returns the value of attribute daemon_data.
12 13 14 |
# File 'lib/qs/payload_handler.rb', line 12 def daemon_data @daemon_data end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
12 13 14 |
# File 'lib/qs/payload_handler.rb', line 12 def logger @logger end |
#redis_item ⇒ Object (readonly)
Returns the value of attribute redis_item.
12 13 14 |
# File 'lib/qs/payload_handler.rb', line 12 def redis_item @redis_item end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/qs/payload_handler.rb', line 23 def run log_received benchmark = Benchmark.measure{ run!(@daemon_data, @redis_item) } @redis_item.time_taken = RoundedTime.new(benchmark.real) log_complete(@redis_item) raise_if_debugging!(@redis_item.exception) end |