Playing with round-robin behavior
This commit is contained in:
parent
10aa737d1d
commit
b8d83c830c
@ -38,7 +38,7 @@ class Sylvilagus::Ch04::AddPointsConsumer
|
|||||||
channel.exchange_declare(
|
channel.exchange_declare(
|
||||||
'upload-pictures', 'fanout', false, true, false, nil
|
'upload-pictures', 'fanout', false, true, false, nil
|
||||||
)
|
)
|
||||||
channel.queue_declare('add-points', false, true, false, nil)
|
channel.queue_declare('add-points', false, false, false, nil)
|
||||||
channel.queue_bind('add-points', 'upload-pictures', '')
|
channel.queue_bind('add-points', 'upload-pictures', '')
|
||||||
|
|
||||||
consumer = Consumer.new(channel)
|
consumer = Consumer.new(channel)
|
||||||
|
@ -40,13 +40,12 @@ class Sylvilagus::Ch04::ResizePictureConsumer
|
|||||||
channel.exchange_declare(
|
channel.exchange_declare(
|
||||||
'upload-pictures', 'fanout', false, true, false, nil
|
'upload-pictures', 'fanout', false, true, false, nil
|
||||||
)
|
)
|
||||||
channel.queue_declare('resize-picture', false, true, false, nil)
|
channel.queue_declare('resize-picture', false, false, false, nil)
|
||||||
channel.queue_bind('resize-picture', 'upload-pictures', '')
|
channel.queue_bind('resize-picture', 'upload-pictures', '')
|
||||||
|
|
||||||
consumer = Consumer.new(channel)
|
consumer = Consumer.new(channel)
|
||||||
puts "Consuming from 'upload-pictures' exchange"
|
puts "Consuming from 'upload-pictures' exchange"
|
||||||
channel.basic_consume('resize-picture', false,
|
channel.basic_consume('resize-picture', false, 'resize-picture-consumer',
|
||||||
"resize-picture-consumer-#{$$}-#{ENV['HOSTNAME']}",
|
|
||||||
false, false, nil, consumer)
|
false, false, nil, consumer)
|
||||||
loop do
|
loop do
|
||||||
break if consumer.done?
|
break if consumer.done?
|
||||||
|
Loading…
Reference in New Issue
Block a user