-
Notifications
You must be signed in to change notification settings - Fork 172
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 object store link #1091
Add object store link #1091
Conversation
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
dac44be
to
4cc97a3
Compare
@@ -850,9 +1066,9 @@ fn is_default<T: Default + Eq>(t: &T) -> bool { | |||
#[derive(Debug, Default, Clone, Serialize, Deserialize, Eq, PartialEq)] | |||
pub struct ObjectLink { | |||
/// Name of the object | |||
pub name: String, | |||
pub name: Option<String>, |
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.
Presumably this doesn't need to be Option<String>
if it's already gated behind AddLinkErrorKind::EmptyName
?
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.
It's still a valid case when adding a link to a bucket instead of object.
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
Until now, the subscription for reading Object data was spawn when calling `bucket.get()`. While that makes sense in many cases when implementing readers, it can lead to unwanted behaviours in NATS. The main issue being - there is no guarantee that user will start reading messages as soon as `bucket.get()` is called. That can lead to unnecesary idling subscription. Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Before this change, users were forced to pass `info` field from `Object`. This is not very ergonomic, as what library needs to add link - a whole [Object], or just [ObjectInfo] should be internal. This change adds a trait that handles that. Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
4cc97a3
to
c56bbe7
Compare
Signed-off-by: Tomasz Pietrek tomasz@nats.io