diff --git a/nats/js/manager.py b/nats/js/manager.py index bfd5937f0..98ccd848f 100644 --- a/nats/js/manager.py +++ b/nats/js/manager.py @@ -147,6 +147,8 @@ async def update_stream( async def delete_stream(self, name: str) -> bool: """ Delete a stream by name. + + :param stream: The name of the stream from which the consumer should be deleted. """ resp = await self._api_request( f"{self._prefix}.STREAM.DELETE.{name}", timeout=self._timeout @@ -263,6 +265,12 @@ async def add_consumer( return api.ConsumerInfo.from_response(resp) async def delete_consumer(self, stream: str, consumer: str) -> bool: + """ + Delete a consumer from a given stream. + + :param stream: The name of the stream from which the consumer should be deleted. + :param consumer: The name of the consumer to be deleted. + """ resp = await self._api_request( f"{self._prefix}.CONSUMER.DELETE.{stream}.{consumer}", b"", @@ -278,6 +286,7 @@ async def consumers_info( """ consumers_info retrieves a list of consumers. Consumers list limit is 256 for more consider to use offset + :param stream: stream to get consumers :param offset: consumers list offset """ @@ -386,6 +395,9 @@ def _lift_msg_to_raw_msg(self, msg) -> api.RawStreamMsg: async def delete_msg(self, stream_name: str, seq: int) -> bool: """ delete_msg retrieves a message from a stream based on the sequence ID. + + :param stream_name: The name of the stream from which the message should be deleted. + :param seq: The sequence id to delete """ req_subject = f"{self._prefix}.STREAM.MSG.DELETE.{stream_name}" req = {"seq": seq}