-
Notifications
You must be signed in to change notification settings - Fork 67
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
Clients v2 #316
Clients v2 #316
Conversation
Codecov Report
@@ Coverage Diff @@
## master #316 +/- ##
==========================================
- Coverage 74.39% 72.71% -1.69%
==========================================
Files 65 71 +6
Lines 3691 3859 +168
==========================================
+ Hits 2746 2806 +60
- Misses 839 939 +100
- Partials 106 114 +8
Continue to review full report at Codecov.
|
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.
looks good overall, just it might be better to split per client (like in #315 ) ?
So that also the review is more structured and easier making it in smaller pieces.
But also happy to go with this bigger one ... given the circumstances and work put into this.
// Close shuts down the producer and waits for any buffered messages to be | ||
// flushed. You must call this function before a producer object passes out of | ||
// scope, as it may otherwise leak memory. | ||
func (ap *AsyncProducer) Close() 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.
maybe we could use defer in this case to make the code more clear
(and return a potential error with a pattern like this pattern like this https://yourbasic.org/golang/defer/#use-func-to-return-a-value ) ?
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.
we might have potentially 2 errors here. the aggregate function merges whose 2 into one. with the mentioned pattern we will only return 1 error which is not what we want here.
|
||
prometheus.MustRegister(messageStatus) | ||
} | ||
|
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.
are status and deliveryType values limited to a specific number ?
Maybe we could use enums or predefined string properties ?
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.
Done
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.
i had to revert one of the values as it broke the tests. the reason is that they are internals and integration tests do not run inside the same package.
// Close shuts down the producer and waits for any buffered messages to be | ||
// flushed. You must call this function before a producer object passes out of | ||
// scope, as it may otherwise leak memory. | ||
func (p *SyncProducer) Close() 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.
same as above ... to consider
@@ -5,7 +5,7 @@ import ( | |||
"io" | |||
"io/ioutil" | |||
|
|||
"github.com/golang/protobuf/proto" | |||
"github.com/golang/protobuf/proto" //nolint:staticcheck |
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 might be a better option to use the golang.org package instead of ignoring the 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.
we have an open ticket for this. Unfortunately it is not straightforward with just an upgrade because it is a breaking change.
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.
🛥️
Which problem is this PR solving?
Closes #311.
Short description of the changes