Skip to content

Commit

Permalink
docs: use DeliverPolicy Enum for deliver_policy in subscriber
Browse files Browse the repository at this point in the history
Updated deliver_policy to use DeliverPolicy enum according to type definition
  • Loading branch information
Majajashka authored Dec 1, 2024
1 parent 9456e7a commit 7c7b2ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/docs_src/nats/js/main.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 7c7b2ce

Please sign in to comment.