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:
guha-rahul
2025-06-18 02:53:03 +05:30
committed by GitHub
parent 2ed2587fc9
commit 79094d70d3
4 changed files with 18 additions and 17 deletions

View File

@ -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.