Closed DVasselli closed 7 months ago
Thanks for the change; however this will deadlock if the timer does fire example. As the timer is not reused there is no real need to drain the channel.
Ohhh I totally misunderstood the documentation of t.Stop()
. I pushed it without the drain nd we'll let the GC take care of the channel after return
You are not the first person to do so. Thanks for the PR.
Happy to have learned something new! Any chance you can make a new tag for this so I can import it?
Sorry - not going to do a new release for every small change. Just get the package with go get /github.com/eclipse/paho.mqtt.golang@master
and you should get a version with the PR included.
The old
time.After
was not stopping the internal timer creating a huge resource overhead for frequently publishing clients. This way we stop the timer in thedefer
increasing efficiency.Signed-off-by: Daniele Vasselli vasselli.daniele@gmail.com