Closed fabianfett closed 1 year ago
I highly recommend marking the types that can be accessed from different threads as Sendable. You only support Swift 5.7+ where Sendable works quite well.
Sendable
This way you would have noticed that this lock is not needed:
https://github.com/funcmike/rabbitmq-nio/blob/80f7af653548c96321d8926de0a90452b6979411/Sources/AMQPClient/AMQPChannels.swift#L18
structs that contain only sendable types are sendable as well. The sensibility is enforced through the copy semantics that structs have.
structs
I highly recommend marking the types that can be accessed from different threads as
Sendable
. You only support Swift 5.7+ whereSendable
works quite well.This way you would have noticed that this lock is not needed:
https://github.com/funcmike/rabbitmq-nio/blob/80f7af653548c96321d8926de0a90452b6979411/Sources/AMQPClient/AMQPChannels.swift#L18
structs
that contain only sendable types are sendable as well. The sensibility is enforced through the copy semantics that structs have.