Modernize invertergui: MQTT write support, HA integration, UI updates
Some checks failed
build / inverter_gui_pipeline (push) Has been cancelled
Some checks failed
build / inverter_gui_pipeline (push) Has been cancelled
This commit is contained in:
18
vendor/github.com/eclipse/paho.mqtt.golang/token.go
generated
vendored
18
vendor/github.com/eclipse/paho.mqtt.golang/token.go
generated
vendored
@@ -17,6 +17,7 @@
|
||||
package mqtt
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -202,3 +203,20 @@ type UnsubscribeToken struct {
|
||||
type DisconnectToken struct {
|
||||
baseToken
|
||||
}
|
||||
|
||||
// TimedOut is the error returned by WaitTimeout when the timeout expires
|
||||
var TimedOut = errors.New("context canceled")
|
||||
|
||||
// WaitTokenTimeout is a utility function used to simplify the use of token.WaitTimeout
|
||||
// token.WaitTimeout may return `false` due to time out but t.Error() still results
|
||||
// in nil.
|
||||
// `if t := client.X(); t.WaitTimeout(time.Second) && t.Error() != nil {` may evaluate
|
||||
// to false even if the operation fails.
|
||||
// It is important to note that if TimedOut is returned, then the operation may still be running
|
||||
// and could eventually complete successfully.
|
||||
func WaitTokenTimeout(t Token, d time.Duration) error {
|
||||
if !t.WaitTimeout(d) {
|
||||
return TimedOut
|
||||
}
|
||||
return t.Error()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user