Skip to content

v3: MQTTNewConnection.withConnection #178

@adam-fowler

Description

@adam-fowler

The init and connect functions of MQTTNewConnection should be considered internal. The public API should be a withConnection style function which is supplied a closure to run using the generated connection. When you exit the closure a DISCONNECT is sent and the connection is closed eg

MQTTNewConnection.withConnection { connection in
    connection.publish(to: "MyTopic", payload: ByteBuffer(string: "Testing"))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions