class hurricane.amqp.basehandler.TopicHandler(queue_name: str, exchange_name: str, host: str, port: int, vhost: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None)[source]

This handler implements Hurricane’s base AMQP consumer that handles unexpected interactions with the message broker such as channel and connection closures. The EXCHANGE_TYPE is topic.


class hurricane.amqp.worker.AMQPClient(consumer_klass: Type[hurricane.amqp.basehandler._AMQPConsumer], queue_name: str, exchange_name: str, amqp_host: str, amqp_port: int, amqp_vhost: str)[source]

This is the AMQP Client that will reconnect, if the nested handler instance indicates that a reconnect is necessary.

run(reconnect: bool = False) None[source]

If reconnect is True, AMQP consumer is running in auto-connect mode. In this case consumer will be executed. If any exception occurs, consumer will be disconnected and after some delay will be reconnected. Then consumer will be restarted. KeyboardInterrupt exception is handled differently and stops consumer. In this case IOLoop will be terminated.

If reconnect is false, consumer will be started, but no exceptions and interruptions will be tolerated.