-
Notifications
You must be signed in to change notification settings - Fork 307
Add api for nats message scheduling #2640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Lancetnik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a little documentation section about new section?
faststream/nats/schemas/schedule.py
Outdated
|
|
||
| __slots__ = ("target", "time") | ||
|
|
||
| def __init__(self, time: datetime | str, target: str, /) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add docstring here
faststream/nats/schemas/schedule.py
Outdated
| from faststream._internal.proto import NameRequired | ||
|
|
||
|
|
||
| class Schedule(NameRequired): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't inherit this class here. You can make a regular dataclass
tests/brokers/nats/test_publish.py
Outdated
| assert await response.decode() == "Hi!", response | ||
|
|
||
| @pytest.mark.asyncio() | ||
| async def test_publish_with_schedule( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, move this test out of class to regular test function
tests/brokers/nats/test_publish.py
Outdated
|
|
||
| assert await response.decode() == "Hi!", response | ||
|
|
||
| @pytest.mark.asyncio() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we need to add connected and nats markers here
Description
This PR provide api for scheduling messages via Nats JetStream
Checklist
just lintshows no errors)just test-coveragejust static-analysis