-
Notifications
You must be signed in to change notification settings - Fork 708
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
[ADDED] PushConsumer implementation in jetstream package #1785
base: main
Are you sure you want to change the base?
Conversation
dd63422
to
ff230a4
Compare
@piotrpio
Since we are adding push consumers to the new package, I guess the statement above is not true, and should be updated? |
No @alexbozhenko , the statement still holds. We still recommend using pull consumers. |
@alexbozhenko I don't think so - pull consumers are still the recommended way to go, we only want to provide an option to use push consumers as: |
ff230a4
to
2b329b3
Compare
Signed-off-by: Piotr Piotrowski <[email protected]>
5e10998
to
b19500d
Compare
Signed-off-by: Piotr Piotrowski <[email protected]>
b19500d
to
7a59b11
Compare
// PushConsumeOpt options: | ||
// | ||
// - Error handling and monitoring can be configured using ConsumeErrHandler. | ||
Consume(handler MessageHandler, opts ...PushConsumeOpt) (ConsumeContext, 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.
Do we want to provide the Messages
variant with Next
? Was it available in old JS? Can't recall.
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 kind of was, via ChanSubscribe
and yes, I think we should add that API, but I would do it in a separate PR.
jetstream/jetstream.go
Outdated
// CreateOrUpdateConsumer creates a push consumer on a given stream with | ||
// given config. If consumer already exists, it will be updated (if | ||
// possible). Consumer interface is returned, allowing to operate on a | ||
// consumer (e.g. fetch messages). |
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.
e.g. fetch messages
is not a best example here ;)
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.
Right, changed to "allowing to consume messages"
Co-authored-by: Tomasz Pietrek <[email protected]>
Co-authored-by: Tomasz Pietrek <[email protected]>
Signed-off-by: Piotr Piotrowski <[email protected]>
4c6dd19
to
6a540ca
Compare
Signed-off-by: Piotr Piotrowski <[email protected]>
This PR introduces a
PushConsumer
implementation in jetstream API. For now it only exposes callback-basedConsume()
implementation.Due to interface differences and breaking change concerns, a completely new set of methods were added to enable operating on push consumers.
Signed-off-by: Piotr Piotrowski [email protected]