From 7c7b2ce9426e80d8da81d09c15d949d44e6e0075 Mon Sep 17 00:00:00 2001 From: Majajashka <96516033+Majajashka@users.noreply.github.com> Date: Sun, 1 Dec 2024 22:11:46 +0400 Subject: [PATCH] docs: use DeliverPolicy Enum for deliver_policy in subscriber Updated deliver_policy to use DeliverPolicy enum according to type definition --- docs/docs_src/nats/js/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/docs_src/nats/js/main.py b/docs/docs_src/nats/js/main.py index a65749b082..715e04fd4b 100644 --- a/docs/docs_src/nats/js/main.py +++ b/docs/docs_src/nats/js/main.py @@ -1,5 +1,6 @@ from faststream import FastStream, Logger from faststream.nats import JStream, NatsBroker +from nats.js.api import DeliverPolicy broker = NatsBroker() app = FastStream(broker) @@ -9,7 +10,7 @@ @broker.subscriber( "js-subject", stream=stream, - deliver_policy="new", + deliver_policy=DeliverPolicy.NEW, ) async def handler(msg: str, logger: Logger): logger.info(msg)