codex.bot icon indicating copy to clipboard operation
codex.bot copied to clipboard

pika does not support connection recovery

Open n0str opened this issue 6 years ago • 0 comments

Provide smth like this https://github.com/pika/pika/issues/858

while True:
    connection = pika.BlockingConnection(parameters)

    channel = connection.channel()
    channel.basic_consume(on_message, 'queue')

    try:
        channel.start_consuming()
    except pika.exceptions.ConnectionClosed:
        LOGGER.info('Connection closed. Recovering')
        continue
    except KeyboardInterrupt:
        channel.stop_consuming()

    connection.close()
    break```

Append this code and create issue for SDK

n0str avatar Dec 10 '18 09:12 n0str