Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Conversation

@cmaglie
Copy link
Member

@cmaglie cmaglie commented Jan 9, 2018

No description provided.

Copy link
Contributor

@mastrolinux mastrolinux left a comment

Choose a reason for hiding this comment

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

Can be merged as is but if @cmaglie can create the generic handler in a short time frame that it is better.

status.Publish()
}
// StatusEvent replies with the current status of the arduino-connector
func (status *Status) StatusEvent(client mqtt.Client, msg mqtt.Message) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@smellai I am wondering if this one was used by either you in the getting started or @matteosuppo in the backend.

status.Error("/upload", errors.Wrapf(err, "stop pid %d", sketch.PID))
return
}
func (status *Status) UploadEvent(client mqtt.Client, msg mqtt.Message) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@cmaglie avoiding having interfaces will force us to keep using mqtt. It could be the time to create a generic MessageHandler that does not care about the used protocol.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've just simplified the usage of callback by removing one indirection, previously UploadCB returned an mqtt.MessageHandler to be registered with mqtt lib

func UploadCB(status *Status) mqtt.MessageHandler {
 	return func(client mqtt.Client, msg mqtt.Message) {
               [...do things with client and msg...]

now UploadCB is the mqtt.MessageHandler:

func (status *Status) UploadEvent(client mqtt.Client, msg mqtt.Message) {
       [...do things with client and msg...]

We are dependent on mqtt exactly as before...

If we want to be protocol-agnostic we should actually try to implement another protocol to see where the hypotetical interface should be placed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Too see the real extension of this commit is better to filter whitespace-diffs:
d324c03?w=1

@cmaglie
Copy link
Member Author

cmaglie commented Jan 10, 2018

should we ignore case for search terms? @mastrolinux

packages are all lower-case (I guess it is by policy on debian?) unless the user types upper case chars in the search box there should be no problems.

@mastrolinux
Copy link
Contributor

the frontend directly converts uppercase to lowercase, that was done by @smellai I am going to merge as it is now

@mastrolinux mastrolinux merged commit f04126d into master Jan 11, 2018
@guerinoni guerinoni deleted the status branch July 21, 2020 06:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants