hirotakaster / MQTT

MQTT for Photon, Spark Core
Other
216 stars 118 forks source link

Callback context #60

Open norgepaul opened 7 years ago

norgepaul commented 7 years ago

Is it possible to add add a constructor overload that accepts a context for the callback so we can have non static callback functions?

If not, do you now of a workaround?

Cheers, Paul

AndrewWeiss commented 7 years ago

@norgepaul, I had a similar need and actually inherited from this MQTT library and implemented a virtual topicPosted method instead of using a callback. Just add it.