mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-10 07:00:54 +00:00
Fix Pubsub
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import logging
|
||||
from typing import Iterable, List, Sequence
|
||||
|
||||
import trio
|
||||
|
||||
from libp2p.network.stream.exceptions import StreamClosed
|
||||
from libp2p.peer.id import ID
|
||||
from libp2p.typing import TProtocol
|
||||
@ -61,6 +63,8 @@ class FloodSub(IPubsubRouter):
|
||||
|
||||
:param rpc: rpc message
|
||||
"""
|
||||
# Checkpoint
|
||||
await trio.sleep(0)
|
||||
|
||||
async def publish(self, msg_forwarder: ID, pubsub_msg: rpc_pb2.Message) -> None:
|
||||
"""
|
||||
@ -102,6 +106,8 @@ class FloodSub(IPubsubRouter):
|
||||
|
||||
:param topic: topic to join
|
||||
"""
|
||||
# Checkpoint
|
||||
await trio.sleep(0)
|
||||
|
||||
async def leave(self, topic: str) -> None:
|
||||
"""
|
||||
@ -110,6 +116,8 @@ class FloodSub(IPubsubRouter):
|
||||
|
||||
:param topic: topic to leave
|
||||
"""
|
||||
# Checkpoint
|
||||
await trio.sleep(0)
|
||||
|
||||
def _get_peers_to_send(
|
||||
self, topic_ids: Iterable[str], msg_forwarder: ID, origin: ID
|
||||
|
||||
Reference in New Issue
Block a user