runtornado: Switch to asyncio event loop.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 6fd1a558b7)
This commit is contained in:
Anders Kaseorg
2022-03-18 00:34:10 -07:00
committed by Tim Abbott
parent b4a0684201
commit 0ccc706f7a
9 changed files with 177 additions and 96 deletions

View File

@@ -307,6 +307,8 @@ class TornadoQueueClient(QueueClient[Channel]):
def _on_connection_closed(
self, connection: pika.connection.Connection, reason: Exception
) -> None:
if self.connection is None:
return
self._connection_failure_count = 1
retry_secs = self.CONNECTION_RETRY_SECS
self.log.warning(
@@ -335,6 +337,7 @@ class TornadoQueueClient(QueueClient[Channel]):
def close(self) -> None:
if self.connection is not None:
self.connection.close()
self.connection = None
def ensure_queue(self, queue_name: str, callback: Callable[[Channel], object]) -> None:
def set_qos(frame: Any) -> None: