Module: EventQ::WorkerId
- Defined in:
- lib/eventq_base/worker_id.rb
Overview
Module to be used by concrete worker classes to tag each thread working on a message Allows to be used in custom logging to track group of log messages per queue message processing.
Instance Method Summary collapse
Instance Method Details
#tag_processing_thread ⇒ Object
5 6 7 |
# File 'lib/eventq_base/worker_id.rb', line 5 def tag_processing_thread Thread.current[key_name] = SecureRandom.uuid end |
#untag_processing_thread ⇒ Object
9 10 11 |
# File 'lib/eventq_base/worker_id.rb', line 9 def untag_processing_thread Thread.current[key_name] = nil end |