     public init(username: String, password: String) {
         self.username = username
         self.password = password
+    }
+}
+
+public struct MQTTPublishOpts {
+    public let max_inflight_messages: UInt32
+    public let message_retry: UInt32
+    
+    public init(max_inflight_messages: UInt32, message_retry: UInt32) {
+        self.max_inflight_messages = max_inflight_messages
+        self.message_retry = message_retry
     }
 }
 

    public var mqttReconnOpts: MQTTReconnOpts
    public var mqttWillOpts: MQTTWillOpts?
    public var mqttAuthOpts: MQTTAuthOpts?
    
    public var onConnectCallback: ((returnCode: Int) -> Void)?
    public var onDisconnectCallback: ((reasonCode: Int) -> Void)!

        }
    }

    public func awaitRequestCompletion() {
        operationQueue.waitUntilAllOperationsAreFinished()
    }

    private func synchronized(operation: (__MosquittoContext, NSOperationQueue) -> Void) {
        objc_sync_enter(self)
        if (!isFinished) {
