rabbitmqpika

How to add timeout using pika 1.1.0?


I have been using pika 0.12.* for a while and I was used to adding timeouts using the following code.

connection = pika.BlockingConnection()
...
connection.add_timeout(30, error)
...

Now I am migrating to use pika 1.1.0 the same add_timeout function doesn't seem to be present in the framework anymore.

However, in the documentation, I could find the function remove_timeout which suggests that I still can add a timeout to my code. Is it still possible to add timeouts using the pika lib?


Solution

  • You should use the call_later method. It was renamed from add_timeout in the 1.0.0 release.