Skip to content

Conversation

PeterAdams-A
Copy link
Contributor

Motivation:

The old lock used is deprecated.

Modifications:

Move to using NIOLockedValueBox

Result:

No deprecation warnings

Motivation:

The old lock used is deprecated.

Modifications:

Move to using NIOLockedValueBox

Result:

No deprecation warnings
}
switch state {
case .connected:
try self.disconect()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty nervous about this function being called with the lock held.

switch self.state {
let (startingState, future) = self.stateStore.withLockedValue { (state: inout State) -> (State, EventLoopFuture<Void>?) in
if case .idle = state {
let future = self.connect(on: eventLoop, logger: logger)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same notes here.

lock.unlock()
let (startingState, task) = self.stateStore.withLockedValue { (state: inout State) -> (State, Task<Void, Swift.Error>?) in
if case .idle = state {
let task = self.connect(logger: logger)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants