Skip to content

Commit

Permalink
docs: use DeliverPolicy Enum for deliver_policy in subscriber (#1952)
Browse files Browse the repository at this point in the history
* docs: use DeliverPolicy Enum for deliver_policy in subscriber

Updated deliver_policy to use DeliverPolicy enum according to type definition

* docs: generate API References

---------

Co-authored-by: Majajashka <[email protected]>
  • Loading branch information
Majajashka and Majajashka authored Dec 1, 2024
1 parent 9456e7a commit f8ab59d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"filename": "docs/docs/en/release.md",
"hashed_secret": "35675e68f4b5af7b995d9205ad0fc43842f16450",
"is_verified": false,
"line_number": 1850,
"line_number": 1898,
"is_secret": false
}
],
Expand All @@ -178,5 +178,5 @@
}
]
},
"generated_at": "2024-11-15T07:38:53Z"
"generated_at": "2024-12-01T18:17:03Z"
}
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 f8ab59d

Please sign in to comment.