Closed kristaps closed 10 years ago
Spinning prevents rabbitpy from working with code that uses gevent and its monkey patch. For example "Connected" wouldn't get printed in the following example as the IO thread will be starved by the main thread spinning in Connection._connect():
from gevent import monkey; monkey.patch_all() import rabbitpy connection = rabbitpy.Connection('amqp://guest:guest@localhost/%2F?locale=en_US.UTF-8') print "Connected" connection.close()
Waiting on an event gives other greenlets a chance to run and the IO thread can complete the connection.
Looks good, thanks!
Spinning prevents rabbitpy from working with code that uses gevent and its monkey patch. For example "Connected" wouldn't get printed in the following example as the IO thread will be starved by the main thread spinning in Connection._connect():
Waiting on an event gives other greenlets a chance to run and the IO thread can complete the connection.