-
Notifications
You must be signed in to change notification settings - Fork 52
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
JetStream consumer options #107
Conversation
* Added header parsing with codes. * Subscription exception to be thrown on dispose
We seem to have an issue with |
_userMessageChannel = Channel.CreateBounded<NatsJSMsg<T?>>(new BoundedChannelOptions(1_000) | ||
{ | ||
FullMode = BoundedChannelFullMode.Wait, | ||
AllowSynchronousContinuations = false, | ||
}); |
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.
should this take the options from NatsSubOpts.ChannelOptions
?
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.
True 💯 I didn't think of that.
_notificationChannel = Channel.CreateBounded<NatsJSNotification>(new BoundedChannelOptions(1_000) | ||
{ | ||
FullMode = BoundedChannelFullMode.DropOldest, | ||
AllowSynchronousContinuations = false, | ||
}); |
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.
1k seems excessive but I don't really know what a good number would be - 10? 100? 😆
Also doesn't really seem worth making configurable. I guess they are small so 1k might be fine.
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
Implement JetStream Consumer API
consume()
options based on ADR-37.The design idea is to implement a
NatsJSSubBase
class to handle control messages and timeouts. Then we can implement specific classes for all three calls,next()
,fetch()
andconsume()
. In this PR onlyconsume()
is implemented.