mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-09 14:40:53 +00:00
Optimize pubsub publishing to support multiple topics in single RPC message (#686)
* init * add newsfragment * lint --------- Co-authored-by: Manu Sheel Gupta <manusheel.edu@gmail.com>
This commit is contained in:
@ -2130,14 +2130,14 @@ class IPubsub(ServiceAPI):
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
async def publish(self, topic_id: str, data: bytes) -> None:
|
||||
async def publish(self, topic_id: str | list[str], data: bytes) -> None:
|
||||
"""
|
||||
Publish a message to a topic.
|
||||
Publish a message to a topic or multiple topics.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
topic_id : str
|
||||
The identifier of the topic.
|
||||
topic_id : str | list[str]
|
||||
The identifier of the topic (str) or topics (list[str]).
|
||||
data : bytes
|
||||
The data to publish.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user