-
Notifications
You must be signed in to change notification settings - Fork 169
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
Direct get #636
Direct get #636
Conversation
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.
Naming bike shedding, mirror raw message API as much as it makes sense
async-nats/src/jetstream/stream.rs
Outdated
Ok(response) | ||
} | ||
|
||
pub async fn direct_get_by_sequence(&self, sequence: u64) -> Result<Message, Error> { |
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.
Naming:
pub async fn direct_get_by_sequence(&self, sequence: u64) -> Result<Message, Error> { | |
pub async fn get_direct_message_by_sequence(&self, sequence: u64) -> Result<Message, Error> { |
async-nats/src/jetstream/stream.rs
Outdated
} | ||
Ok(response) | ||
} | ||
pub async fn direct_get_next_for_subject(&self, subject: String) -> Result<Message, Error> { |
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.
Mirrors raw message API
pub async fn direct_get_next_for_subject(&self, subject: String) -> Result<Message, Error> { | |
pub async fn get_next_direct_message_by_subject(&self, subject: String) -> Result<Message, Error> { |
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.
direct.get
-> get_direct
is fine. The difference in API is though, that direct supports also next
, so message_by_subject
is ambiguous enough, that user would have to read docs to be sure if its next or last.
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.
Completely qualify it? e.g get_next_direct_message_by_subject
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.
I don't like phrasing get....direct_message
. It's not a direct message. The name comes from the fact it can be ... fetched from any replica set member. Direct message does not make sense. Its Directly getting a normal Stream Message.
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.
lgtm
No description provided.