xHasKx / luamqtt

luamqtt - Pure-lua MQTT v3.1.1 and v5.0 client
https://xhaskx.github.io/luamqtt/
MIT License
154 stars 41 forks source link

ioloop default args #22

Closed dvv closed 4 years ago

dvv commented 4 years ago

Hi!

How do I specify own args (esp. timeout) to default autocreated ioloop? Can't see how to pass them to https://github.com/xHasKx/luamqtt/blob/master/mqtt/ioloop.lua#L168

TIA

dvv commented 4 years ago

I worked this around with

mqtt.get_ioloop().args.timeout = 0.100
mqtt.run_ioloop(client)

If this is the way the issue is done.

xHasKx commented 4 years ago

@dvv , I've updated the library version to v3.2.1, better use this:

local ioloop = require("mqtt.ioloop")
-- ...
ioloop.get(true, {timeout = 0.100})
mqtt.run_ioloop(client)

Any feedback appreciated :)

dvv commented 4 years ago

Excellent. Thank you!