Class: Messaging::Adapters::Test::Consumer
- Inherits:
-
Object
- Object
- Messaging::Adapters::Test::Consumer
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
#shutdown ⇒ Object
28
29
30
|
# File 'lib/messaging/adapters/test/consumer.rb', line 28
def shutdown
logger.info "Consumer #{name} stopped"
end
|
#start ⇒ Object
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
|
#stop ⇒ Object
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
|