-
Notifications
You must be signed in to change notification settings - Fork 671
MF-1053 - Add disconnect event to MQTT adapter #1056
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
Conversation
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Codecov Report
@@ Coverage Diff @@
## master #1056 +/- ##
==========================================
+ Coverage 79.03% 79.06% +0.03%
==========================================
Files 95 95
Lines 6610 6610
==========================================
+ Hits 5224 5226 +2
+ Misses 1076 1075 -1
+ Partials 310 309 -1
Continue to review full report at Codecov.
|
mqtt/adapter.go
Outdated
e.logger.Info(fmt.Sprintf("Error in mqtt publish %s", err)) | ||
return | ||
for _, mp := range e.pubs { | ||
if err := mp.Publish(context.TODO(), "", msg); err != nil { |
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.
Can we have async publish with a separate routine for each publisher?
mqtt/adapter.go
Outdated
return | ||
for _, mp := range e.pubs { | ||
go func() { | ||
if err := mp.Publish(context.TODO(), "", msg); err != nil { |
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.
loopclosure: loop variable mp captured by func literal (from govet
)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Add disconnect event to mProxy Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Rename publishers to pubs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Use acync publishers Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: Dušan Borovčanin dusan.borovcanin@mainflux.com
What does this do?
This pull request updates MQTT adapter to use the most recent version of
mProxy
(0.1.1). It also introduces minor optimizations and code refactoring.Which issue(s) does this PR fix/relate to?
This pull request resolves #1053.
List any changes that modify/break current functionality
A package rename might cause some issues in case you're importing the MQTT adapter package.
Have you included tests for your changes?
No.
Did you document any new/modified functionality?
No.