Created
November 24, 2014 20:31
-
-
Save adamkuipers/49d76c6494eb50d49821 to your computer and use it in GitHub Desktop.
Creating rabbitmq connection on after_fork callback.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resque.after_fork do |job| | |
$rabbitmq_connection = Bunny.new(AMQP_URL) | |
$rabbitmq_connection.start | |
$rabbitmq_channel = $rabbitmq_connection.create_channel | |
$rabbitmq_exchange = $rabbitmq_channel.topic('stream', durable: true) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment