mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Remove leftover prints
This commit is contained in:
@ -153,14 +153,11 @@ class Pubsub:
|
|||||||
peer_id = stream.mplex_conn.peer_id
|
peer_id = stream.mplex_conn.peer_id
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
print("!@# continuously_read_stream: waiting")
|
|
||||||
incoming: bytes = await read_varint_prefixed_bytes(stream)
|
incoming: bytes = await read_varint_prefixed_bytes(stream)
|
||||||
print(f"!@# continuously_read_stream: incoming={incoming}")
|
|
||||||
rpc_incoming: rpc_pb2.RPC = rpc_pb2.RPC()
|
rpc_incoming: rpc_pb2.RPC = rpc_pb2.RPC()
|
||||||
rpc_incoming.ParseFromString(incoming)
|
rpc_incoming.ParseFromString(incoming)
|
||||||
|
|
||||||
if rpc_incoming.publish:
|
if rpc_incoming.publish:
|
||||||
print("!@# continuously_read_stream: publish")
|
|
||||||
# deal with RPC.publish
|
# deal with RPC.publish
|
||||||
for msg in rpc_incoming.publish:
|
for msg in rpc_incoming.publish:
|
||||||
if not self._is_subscribed_to_msg(msg):
|
if not self._is_subscribed_to_msg(msg):
|
||||||
@ -168,7 +165,6 @@ class Pubsub:
|
|||||||
asyncio.ensure_future(self.push_msg(msg_forwarder=peer_id, msg=msg))
|
asyncio.ensure_future(self.push_msg(msg_forwarder=peer_id, msg=msg))
|
||||||
|
|
||||||
if rpc_incoming.subscriptions:
|
if rpc_incoming.subscriptions:
|
||||||
print("!@# continuously_read_stream: subscriptions")
|
|
||||||
# deal with RPC.subscriptions
|
# deal with RPC.subscriptions
|
||||||
# We don't need to relay the subscription to our
|
# We don't need to relay the subscription to our
|
||||||
# peers because a given node only needs its peers
|
# peers because a given node only needs its peers
|
||||||
@ -181,7 +177,6 @@ class Pubsub:
|
|||||||
# This is necessary because `control` is an optional field in pb2.
|
# This is necessary because `control` is an optional field in pb2.
|
||||||
# Ref: https://developers.google.com/protocol-buffers/docs/reference/python-generated#singular-fields-proto2 # noqa: E501
|
# Ref: https://developers.google.com/protocol-buffers/docs/reference/python-generated#singular-fields-proto2 # noqa: E501
|
||||||
if rpc_incoming.HasField("control"):
|
if rpc_incoming.HasField("control"):
|
||||||
print("!@# continuously_read_stream: control")
|
|
||||||
# Pass rpc to router so router could perform custom logic
|
# Pass rpc to router so router could perform custom logic
|
||||||
await self.router.handle_rpc(rpc_incoming, peer_id)
|
await self.router.handle_rpc(rpc_incoming, peer_id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user