From ff3cc46846d3af86207041150d3da220cb4e2f63 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Wed, 11 Oct 2023 15:28:23 +0300 Subject: [PATCH] chore: rm loop from __init__ --- docs/source/rabbitmq-tutorial/examples/6-rpc/rpc_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/rabbitmq-tutorial/examples/6-rpc/rpc_client.py b/docs/source/rabbitmq-tutorial/examples/6-rpc/rpc_client.py index c60f40fc..bb313784 100644 --- a/docs/source/rabbitmq-tutorial/examples/6-rpc/rpc_client.py +++ b/docs/source/rabbitmq-tutorial/examples/6-rpc/rpc_client.py @@ -15,7 +15,6 @@ class FibonacciRpcClient: def __init__(self) -> None: self.futures: MutableMapping[str, asyncio.Future] = {} - self._loop = asyncio.get_running_loop() async def connect(self) -> "FibonacciRpcClient": self.connection = await connect("amqp://guest:guest@localhost/") @@ -35,7 +34,8 @@ async def on_response(self, message: AbstractIncomingMessage) -> None: async def call(self, n: int) -> int: correlation_id = str(uuid.uuid4()) - future = self._loop.create_future() + loop = asyncio.get_running_loop() + future = loop.create_future() self.futures[correlation_id] = future