funcmike/rabbitmq-nio

AMQPClient isConnect concurrency issue

Closed this issue · 0 comments

There is no guarantee to run code below in correct order.

self.connection = connection
self.isConnect.store(false, ordering: .relaxed)

Less fragile design is to just use locks and switch to state enum (proposed by @fabianfett )

    enum State {
        case connecting
        case connected(AMQPConnection)
        ...
    }