Class: Messaging::Adapters::Test::Consumer

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Includes:
Routing
Defined in:
lib/messaging/adapters/test/consumer.rb

Instance Method Summary collapse

Methods included from Routing

#clear_routes!, #handle, included, #on

Instance Method Details

#shutdownObject



28
29
30
# File 'lib/messaging/adapters/test/consumer.rb', line 28

def shutdown
  logger.info "Consumer #{name} stopped"
end

#startObject



14
15
16
17
18
19
20
# File 'lib/messaging/adapters/test/consumer.rb', line 14

def start
  logger.info "Consumer #{name} started"
  @running = true
  process_messages
ensure
  shutdown
end

#stopObject



22
23
24
25
26
# File 'lib/messaging/adapters/test/consumer.rb', line 22

def stop
  @running = false
  queue << :stop
  logger.info "Consumer #{name} stopping"
end