MQTT-Client-Framework icon indicating copy to clipboard operation
MQTT-Client-Framework copied to clipboard

Inconsistencies in APIs between MQTTSession and MQTTSessionManager

Open YueLiXing opened this issue 7 years ago • 4 comments
trafficstars

Based on the current mechanism, we can only know that the message is sent successfully, but the callback of the failed message failed. Please add

YueLiXing avatar Apr 10 '18 03:04 YueLiXing

There is async API:

- (UInt16)publishData:(NSData *)data onTopic:(NSString *)topic retain:(BOOL)retainFlag qos:(MQTTQosLevel)qos publishHandler:(MQTTPublishHandler)publishHandler;

and publish handler exposes error if it happens.

Is that what you need?

jcavar avatar Apr 25 '18 09:04 jcavar

I am sorry. I saw the API in the MQTTSessionManager,I've noticed this in the MQTTSession. If you can extract this API to MQTTSessionManager, easy for use.

YueLiXing avatar Apr 25 '18 10:04 YueLiXing

Yes, I agree, we have problem with inconsistent APIs. I am however not sure if we just want to duplicate this in manager, because that might lead to bloated manager.

I think manager could easily be extracted as separate project and we can consider its design separately.

jcavar avatar Apr 25 '18 10:04 jcavar

Yes, when I first used this library, I noticed that there were two folders, Manager and Min. Then I found that I only needed API in Manager,This leads me to not find such powerful APi that is so easy to use.I believe that more than one person made this mistake.

If the manager will be edesigned,what a good news!

YueLiXing avatar Apr 25 '18 10:04 YueLiXing