feat: Cleans up some of the shutdown logic so that the MQTTClient is disconnected properly.

This commit is contained in:
2024-11-12 22:19:09 -05:00
parent fbbd65f7ae
commit efd9907b4a
4 changed files with 8 additions and 12 deletions

View File

@@ -153,10 +153,6 @@ private actor MQTTTopicListener {
}
}
client.addShutdownListener(named: name) { _ in
self.shutdown()
}
return stream
}
@@ -167,6 +163,8 @@ private actor MQTTTopicListener {
nonisolated func shutdown() {
client.logger.trace("Closing topic listener...")
continuation.finish()
client.removePublishListener(named: name)
client.removeShutdownListener(named: name)
Task { await self.setIsShuttingDown() }
}
}