Skip to content
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 ability to fetch stream subjects #1329

Merged
merged 10 commits into from
Oct 24, 2024
Merged

Add ability to fetch stream subjects #1329

merged 10 commits into from
Oct 24, 2024

Conversation

Jarema
Copy link
Member

@Jarema Jarema commented Oct 11, 2024

This is a draft solution that tries to find a sensible way to fetch subjects for from stream info, which returns subjects with pagination nested under info.state.

Signed-off-by: Tomasz Pietrek [email protected]

Signed-off-by: Tomasz Pietrek <[email protected]>
Signed-off-by: Tomasz Pietrek <[email protected]>
Signed-off-by: Tomasz Pietrek <[email protected]>
Signed-off-by: Tomasz Pietrek <[email protected]>
Signed-off-by: Tomasz Pietrek <[email protected]>
@caspervonb caspervonb self-requested a review October 14, 2024 15:09
Signed-off-by: Tomasz Pietrek <[email protected]>
Signed-off-by: Tomasz Pietrek <[email protected]>
Signed-off-by: Tomasz Pietrek <[email protected]>
Signed-off-by: Tomasz Pietrek <[email protected]>
@Jarema Jarema marked this pull request as ready for review October 16, 2024 10:43
@caspervonb
Copy link
Collaborator

caspervonb commented Oct 24, 2024

info_builder feels a bit awkward of a name, not sure if I have anything better in mind.

/// # Ok(())
/// # }
/// ```
pub async fn info_with_subjects<F: AsRef<str>>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intend on adding overloads with deleted etc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. Will add to this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, no.
I was wondering if we should have only the builder.
Those overloads look a bit silly at this point - with 3 different options, all valid choices.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, sgtm

/// let mut stream = jetstream.get_stream("events").await?;
///
/// let mut info = stream
/// .info_builder()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels any better? or same?

Suggested change
/// .info_builder()
/// .info_fetcher()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe sounds bit better, but at the same time - does not have notion that its a builder.

Copy link
Collaborator

@caspervonb caspervonb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Jarema Jarema merged commit 1fbcfdd into main Oct 24, 2024
12 checks passed
@Jarema Jarema deleted the stream_subjects branch October 24, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants