interface mqtt { /// Errors related to interacting with Mqtt variant error { /// An invalid address string invalid-address, /// There are too many open connections too-many-connections, /// Connection failure e.g. address not allowed. connection-failed(string), /// Some other error occurred other(string), } /// QoS for publishing Mqtt messages enum qos { at-most-once, at-least-once, exactly-once, } resource connection { /// Open a connection to the Mqtt instance at `address`. open: static func(address: string, username: string, password: string, keep-alive-interval-in-secs: u64) -> result; /// Publish an Mqtt message to the specified `topic`. publish: func(topic: string, payload: payload, qos: qos) -> result<_, error>; } /// The message payload. type payload = list; }