Created
August 31, 2011 03:23
-
-
Save DylanLacey/1182745 to your computer and use it in GitHub Desktop.
EM & AMQP
This file contains hidden or 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
class Main | |
t = Thread.new do | |
EventMachine.run | |
end | |
sleep(5) | |
puts "Asimov: Attempting Connection" | |
AMQP.connect( | |
:on_possible_authentication_failure => Proc.new {puts("Asimov: Possible Authentication Failure")}, | |
:on_tcp_connection_failure => Proc.new {puts("Asimov: TCP failure")}, | |
:on_error => Proc.new {puts("Fucked")}, | |
:on_tcp_loss => Proc.new {puts("Still Fucked")}, | |
:on_connection_interrruption => Proc.new {puts("DODGY")} | |
) do |connection| | |
puts "Asimov: Connected to host" | |
end | |
puts "Blocked like a boss" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment