delayed job and amqp gem

59 views
Skip to first unread message

phil...@automate-dev.com

unread,
Apr 29, 2013, 10:45:26 AM4/29/13
to ruby...@googlegroups.com
Hi,

I'm currently trying to get the amqp gem working within a Delayed Job.

If I use my client outside delayed job, everything works fine: https://gist.github.com/anonymous/5482005

However I put similar code into a Delayed Job, then I get no errors, but the messages never arrive on the broker.

https://gist.github.com/anonymous/5481975

My guess is that is has something to do with EventMachine, but I'm currently clueless. So any help is very much appreciated.

Thanks in advance,

Philippe

Michael Klishin

unread,
Apr 29, 2013, 11:54:23 AM4/29/13
to ruby...@googlegroups.com

My guess is that is has something to do with EventMachine, but I'm currently clueless

DelayedJob forks and the child process does not inherit EM thread. So you need to connect in the child process.
This situation is the same as with Unicorn [1]. Reconnecting from fork(2) children would also be necessary with any library that uses
sockets.

Reply all
Reply to author
Forward
0 new messages