Skip to content

Commit

Permalink
chore: rm loop from __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
Olegt0rr committed Oct 11, 2023
1 parent c3d44ee commit ff3cc46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/rabbitmq-tutorial/examples/6-rpc/rpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand All @@ -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

Expand Down

0 comments on commit ff3cc46

Please sign in to comment.