Add checkpoints in PubsubNotifee
Since some of the methods in `PubsubNotifee` are doing nothing, add checkpoints to yield control.
This commit is contained in:
parent
66975ae3f2
commit
857bb34f4e
|
@ -32,10 +32,10 @@ class PubsubNotifee(INotifee):
|
||||||
self.dead_peers_queue = dead_peers_queue
|
self.dead_peers_queue = dead_peers_queue
|
||||||
|
|
||||||
async def opened_stream(self, network: INetwork, stream: INetStream) -> None:
|
async def opened_stream(self, network: INetwork, stream: INetStream) -> None:
|
||||||
...
|
await trio.hazmat.checkpoint()
|
||||||
|
|
||||||
async def closed_stream(self, network: INetwork, stream: INetStream) -> None:
|
async def closed_stream(self, network: INetwork, stream: INetStream) -> None:
|
||||||
...
|
await trio.hazmat.checkpoint()
|
||||||
|
|
||||||
async def connected(self, network: INetwork, conn: INetConn) -> None:
|
async def connected(self, network: INetwork, conn: INetConn) -> None:
|
||||||
"""
|
"""
|
||||||
|
@ -67,7 +67,7 @@ class PubsubNotifee(INotifee):
|
||||||
...
|
...
|
||||||
|
|
||||||
async def listen(self, network: INetwork, multiaddr: Multiaddr) -> None:
|
async def listen(self, network: INetwork, multiaddr: Multiaddr) -> None:
|
||||||
...
|
await trio.hazmat.checkpoint()
|
||||||
|
|
||||||
async def listen_close(self, network: INetwork, multiaddr: Multiaddr) -> None:
|
async def listen_close(self, network: INetwork, multiaddr: Multiaddr) -> None:
|
||||||
...
|
await trio.hazmat.checkpoint()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user