Skip to content

Commit 0559463

Browse files
Change NopReceiver creating of asyncio.Future to loop.create_future()
Because it is recommended in the python documentation. This way alternative event loop implementations can inject their own optimized implementations of a Future object.
1 parent c7d8e69 commit 0559463

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/frequenz/channels/experimental/_nop_receiver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ class NopReceiver(Receiver[ReceiverMessageT_co]):
2020

2121
def __init__(self) -> None:
2222
"""Initialize this instance."""
23-
self._ready_future: asyncio.Future[bool] = asyncio.Future()
23+
self._ready_future: asyncio.Future[bool] = (
24+
asyncio.get_running_loop().create_future()
25+
)
2426

2527
@override
2628
async def ready(self) -> bool:

0 commit comments

Comments
 (0)