-
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
Add JetStream types and basics #457
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.
First pass, bit of bike shedding on our old abbreviations.
async-nats/src/jetstream/types.rs
Outdated
skip_serializing_if = "is_default" | ||
)] | ||
/// Indicates if rollups will be allowed or not. | ||
pub allow_rollup: bool, |
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.
Do we wanna be explicit?
pub allow_rollup: bool, | |
pub allow_rollup_headers: bool, |
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.
No. I would stick to name describing behaviour.
async-nats/src/jetstream/mod.rs
Outdated
@@ -15,6 +15,7 @@ use crate::Client; | |||
|
|||
pub mod context; | |||
pub mod response; | |||
pub mod types; |
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.
Lets scope this to jetstream streams, we'll spot any duplication easily.
pub mod types; | |
pub mod stream; |
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 renamed the whole file. makes more sense.
StreamConfig: From<S>, | ||
{ | ||
let config: StreamConfig = stream_config.into(); | ||
if config.name.is_empty() { |
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.
Lets ditch this check and add a test for it, ensure the server does still error.
if config.name.is_empty() { |
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.
as found out, it returns no responders
. Im still all for server-checks, but in this case... I would have this in.
async-nats/src/jetstream/context.rs
Outdated
@@ -49,4 +54,25 @@ impl Context { | |||
|
|||
Ok(response) | |||
} | |||
|
|||
pub async fn add_stream<S>(&mut self, stream_config: S) -> Result<StreamInfo, 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.
Add versus create? endpoint is create.
pub async fn add_stream<S>(&mut self, stream_config: S) -> Result<StreamInfo, Error> | |
pub async fn create_stream<S>(&mut self, stream_config: S) -> Result<StreamInfo, 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.
and all APIs are add.... hm.
9e23a74
to
e7f49cc
Compare
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.