Class: BunnyCarrot::BusinessActor
- Inherits:
-
LoggingActor
- Object
- Concurrent::Actor
- LoggingActor
- BunnyCarrot::BusinessActor
- Defined in:
- lib/bunny_carrot/business_actor.rb
Instance Method Summary collapse
- #act(message_hash) ⇒ Object
-
#initialize ⇒ BusinessActor
constructor
A new instance of BusinessActor.
Methods inherited from LoggingActor
Methods included from Logger
Constructor Details
#initialize ⇒ BusinessActor
Returns a new instance of BusinessActor.
4 5 6 7 |
# File 'lib/bunny_carrot/business_actor.rb', line 4 def initialize super() logger.info 'Business actor initialized' end |
Instance Method Details
#act(message_hash) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/bunny_carrot/business_actor.rb', line 9 def act() payload = .fetch(:payload) worker = .fetch(:worker) headers = .fetch(:message_headers) logger.info "Business #{self.object_id} is acting: #{payload.inspect}" worker.run(payload, headers) true end |