I love how puka provides the freedom for me to write a truly non-blocking, asynchronous, single threaded app, but I was having a major headache with performing TLS connections like this. Below sample code demonstrates what I'm trying to do.
import puka
import select
def on_connection (promise, result):
print 'on_connection %r' % result
client = puka.Client('amqps:///')
client.connect(callback=on_connection)
fd = client.fileno()
while True:
exception = readers = [fd]
if client.needs_write():
writers = [fd]
else:
writers = []
rready, wready, xready = select.select(readers, writers, exception)
if len(rready) or len(xready):
client.on_read()
if len(wready):
client.on_write()
client.run_any_callbacks()
But in the case of TLS enabled brokers, I would randomly get the following traceback during start up.
I love how puka provides the freedom for me to write a truly non-blocking, asynchronous, single threaded app, but I was having a major headache with performing TLS connections like this. Below sample code demonstrates what I'm trying to do.
But in the case of TLS enabled brokers, I would randomly get the following traceback during start up.
There might be room to remove some of the TLS handshaking code, but for now this fixes my problem.