diff options
author | Ethel Morgan <eth@ethulhu.co.uk> | 2020-06-28 21:50:23 +0100 |
---|---|---|
committer | Ethel Morgan <eth@ethulhu.co.uk> | 2020-06-28 21:50:23 +0100 |
commit | 264ae5e425e3c6f90fbea88ad66852a0b5186428 (patch) | |
tree | 341b55c763bb7ba808191c47dba972d44da4fe17 | |
parent | e825e6820389fab7c97ae3665155401124ab8ecf (diff) |
run callback in a goroutinev0.0.4
-rw-r--r-- | catbus.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -106,7 +106,7 @@ func (c *client) Subscribe(topic string, f MessageHandler) error { return c.mqtt.Subscribe(topic, atLeastOnce, func(_ mqtt.Client, msg mqtt.Message) { c.storePayload(msg.Topic(), Retention(msg.Retained()), string(msg.Payload())) - f(c, messageFromMQTTMessage(msg)) + go f(c, messageFromMQTTMessage(msg)) }).Error() } |