I have a collection of Rails apps, and I want to have some of them subscribe to a channel waiting for messages. They are all connected to the same Redis server already, but I'm just not sure where to place the code that starts the subscriber to listen for messages.
Should I have a class in config/initializers
that starts a new thread and calls the redis.subscribe method?
Should I perform a Resque job from an initializer class that is in its own dedicated queue and has its own dedicated worker which then calls the redis.subscribe
?
Are there other ideas of how I should do this? Or does this just not makes sense overall?
I haven't full tried either yet, I have just been fumbling around looking for recommendations.