Two threads in initializer on rails not working
- by Luccas
Initially I was using one thread to listen a queue from amazon and works perfectly.
aws.rb
Thread.new do
my_queue = AWS::SQS::Queue.new(SQSADDR['my_queue'])
my_queue.poll do |msg|
...
but now I appended another thread to listen another queue:
...
Thread.new do
my_another_queue = AWS::SQS::Queue.new(SQSADDR['my_another_queue'])
my_another_queue.poll do |msg|
...
and now it seems to not work. Only the last one receives response...
What is going on?