lib/amqp.rb in amqp-0.6.0 vs lib/amqp.rb in amqp-0.6.4
- old
+ new
@@ -36,11 +36,14 @@
# connection timeout
:timeout => nil,
# logging
- :logging => false
+ :logging => false,
+
+ # ssl
+ :ssl => false
}
end
# Must be called to startup the connection to the AMQP server.
#
@@ -95,8 +98,18 @@
@conn.close{
yield if block_given?
@conn = nil
@closing = false
}
+ end
+ end
+
+ def self.fork workers
+ EM.fork(workers) do
+ # clean up globals in the fork
+ Thread.current[:mq] = nil
+ AMQP.instance_variable_set('@conn', nil)
+
+ yield
end
end
end