hybridgroup / gobot

Golang framework for robotics, drones, and the Internet of Things (IoT)
https://gobot.io
Other
8.89k stars 1.04k forks source link

Should mqtt Adaptor provide access to underline paho.Client instance? #682

Open andrewebdev opened 5 years ago

andrewebdev commented 5 years ago

So I've seen A couple of instances where people are asking for functionality in mqtt.Adaptor that the paho.Client already provides.

I suspect gobot it attempting to wrap some of the tedious interfaces to make it easier to work with the paho library. I also find that I need access to something that paho.Client already provides ( paho.Client.IsConnected() in my case). It feels a bit cumbersome to have to create wrappers for every method or field that we may want to have access to.

Can we possibly make the mqtt.Adaptor.client field public?

This would give us the opportunity to drop down to a lower level if we need to go deeper into the internals, rather than having to create pull requests just for a simple wrapper.

PS: I can contribute a PR to this if this is something useful and if gobot team agrees.

deadprogram commented 5 years ago

I think this is an excellent idea. Yes, please.