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