mcollina / mqtt-level-store

Store your in-flight MQTT message on Level, for Node
MIT License
24 stars 11 forks source link

Use callback style in `Manager.close()`. #13

Closed ogis-fujiwara closed 5 years ago

ogis-fujiwara commented 6 years ago

Call close() method of each resources by callback style because close() method of incoming, outgoing, _sublevel, _level can take callback function as a parameter.

Outcome: This fix guarantees the sequence of resource closing.

ogis-fujiwara commented 6 years ago

Original implementation has a possibility that some resources has not been closed when done() called. This changes make sure to ensure all 4 resources closed before done() called.

ogis-fujiwara commented 6 years ago

I pushed wrong code by my mistake, so I close the PR. I will create the new PR soon. I can force update my PR but according to CONTRIBUTION.md, I understand that I shouldn't do that.

mcollina commented 6 years ago

No force push on master, here you can do whatever you want.

Il giorno ven 14 set 2018 alle 07:35 Masaaki Fujiwara < notifications@github.com> ha scritto:

I pushed wrong code by my mistake, so I close the PR. I will create the new PR soon. I can force update my PR but according to CONTRIBUTION.md https://github.com/mqttjs/MQTT.js/blob/master/CONTRIBUTING.md, I understand that I shouldn't do that.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/mcollina/mqtt-level-store/pull/13#issuecomment-421236282, or mute the thread https://github.com/notifications/unsubscribe-auth/AADL43tev2KzMwWSlJjNDJZkWN3h5sBGks5ua0AagaJpZM4WmcBP .

ogis-fujiwara commented 6 years ago

I rewrote it to close resources by parallelly.

ogis-fujiwara commented 6 years ago

I've pushed above changes.

ogis-fujiwara commented 5 years ago

Thank you very much for merging.