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 streams to push consumers #527

Merged
merged 17 commits into from
Jul 8, 2022
Merged

Conversation

caspervonb
Copy link
Collaborator

No description provided.

@caspervonb caspervonb marked this pull request as ready for review July 4, 2022 11:33
@caspervonb caspervonb requested a review from Jarema July 4, 2022 11:34
}

impl futures::Stream for Stream {
type Item = Message;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Result<Message, Error>? that would mean tracking publish attempts in response to flow control etc

Copy link
Member

Choose a reason for hiding this comment

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

I think that this can be answered as we discussed at client sync: we're aiming to report on any errors on specific consumers/subscriptions instead of silently passing by them or reporting them on registered callback.

So, Result<Message, Error> sounds better.
For sure we need that for Pull, and handling those errors differently (i.e. callback on Consumer) would make pretty inconsistent API for no good reason.

}

impl futures::Stream for Stream {
type Item = Message;
Copy link
Member

Choose a reason for hiding this comment

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

I think that this can be answered as we discussed at client sync: we're aiming to report on any errors on specific consumers/subscriptions instead of silently passing by them or reporting them on registered callback.

So, Result<Message, Error> sounds better.
For sure we need that for Pull, and handling those errors differently (i.e. callback on Consumer) would make pretty inconsistent API for no good reason.

async-nats/src/jetstream/consumer/push.rs Outdated Show resolved Hide resolved
async-nats/src/jetstream/consumer/push.rs Outdated Show resolved Hide resolved
async-nats/src/jetstream/consumer/push.rs Outdated Show resolved Hide resolved
@caspervonb caspervonb requested a review from Jarema July 8, 2022 09:12
continue;
}
Some(_) => {
continue;
Copy link
Member

Choose a reason for hiding this comment

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

are we sure that there are no other statuses we have to handle in any way? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fairly sure, should be at parity with sync at-least.

Copy link
Member

Choose a reason for hiding this comment

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

Ok.

Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

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

LGTM!

@caspervonb caspervonb merged commit af8589b into nats-io:main Jul 8, 2022
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