Class: RabbitMQ::Actors::Base::Agent Abstract
- Inherits:
-
Object
- Object
- RabbitMQ::Actors::Base::Agent
- Defined in:
- lib/rabbitmq/actors/base/agent.rb
Overview
This class is abstract.
Subclass and override #pre_initialize and/or #post_initialize to define actual agent classes.
The base class for RabbitMQ producers, workers, publishers, consumers…
Instance Attribute Summary collapse
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
Instance Method Summary collapse
-
#initialize(**opts) ⇒ Agent
constructor
Instantiate a new agent.
Constructor Details
#initialize(**opts) ⇒ Agent
Instantiate a new agent. #pre_initialize and #post_initialize methods are called just at the beginning and end respectively. Redefine them in your subclass to complete your subclass initialization process.
Rest of options required by your subclasses.
49 50 51 52 53 54 |
# File 'lib/rabbitmq/actors/base/agent.rb', line 49 def initialize(**opts) pre_initialize(**opts) set_queue(opts[:queue_name], **opts) if opts[:queue_name] set_logger(opts[:logger]) post_initialize(**opts) end |
Instance Attribute Details
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
35 36 37 |
# File 'lib/rabbitmq/actors/base/agent.rb', line 35 def queue @queue end |