moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 507 forks source link

UpdateOfflinePacket is called on all forwards #469

Closed behrad closed 8 years ago

behrad commented 8 years ago

Why are we updating all offline packets? https://github.com/mcollina/mosca/blob/master/lib/client.js#L267

This would be a huge waste in high qos>0 publish/forward rates.

Isn't better to pass the knowledge of if it should be updated to client#forward to only update needed packets.

mcollina commented 8 years ago

I'm not understading what you propose, and what is the issue here. Il giorno dom 8 mag 2016 alle 09:31 Behrad notifications@github.com ha scritto:

Why are we updating all offline packets? https://github.com/mcollina/mosca/blob/master/lib/client.js#L267

This would be a huge waste in high qos>0 publish/forward rates.

Isn't better to pass the knowledge of if it should be updated to client#forward to only update needed packets.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/mcollina/mosca/issues/469

behrad commented 8 years ago

Why is UpdateOfflinePacket called in client#forward? Do we need to update stored packet before forwarding to client?

mcollina commented 8 years ago

Yes, it needs to, as the messageId needs to be persisted (for offline).

mcollina commented 8 years ago

Closing, feel free to reopen.