You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not something that I personally am particularly interested in implementing; however I'll consider a pull request.
Note that I am concerned about the continuing increase in the number of options so feel that this would best be implemented in a more generic way. I'm thinking something like:
typeCommsNotificationint64const (
UndefinedCommsNotification=iotaAttemptConnectionFailedConnectRetryFailed
)
// CommsNotificationHandler is invoked upon various changes to status of the connection to the brokertypeCommsNotificationHandlerfunc(typeCommsNotification, err error.Error, extraDatainterface{})
// SetConnectionLostHandler will set the OnConnectionLost callback to be executed// in the case where the client unexpectedly loses connection with the MQTT broker.func (o*ClientOptions) SetCommsNotificationHandler(handlerCommsNotificationHandler) *ClientOptions {
o.CommsNotificationHandler=CommsNotificationHandlerreturno
}
This is a rough sketch; my thinking is that this could be expanded to include a range of notifications (e.g. TCP Dial failed, Clean disconnect etc) as required and users could ignore messages they are not interested in. The extraData field is there because in some cases more info would be nice (i.e. knowing which broker attemptConnection() failed to connect to).
like this:
The text was updated successfully, but these errors were encountered: