Skip to content

no asynchronous shutdown method #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
weissi opened this issue Nov 4, 2019 · 1 comment · Fixed by #183
Closed

no asynchronous shutdown method #126

weissi opened this issue Nov 4, 2019 · 1 comment · Fixed by #183
Assignees
Labels
🆕 semver/minor Adds new public API.
Milestone

Comments

@weissi
Copy link
Contributor

weissi commented Nov 4, 2019

async-http-client only has a synchronous shutdown method but it'd be great to have an asynchronous one too.

@weissi
Copy link
Contributor Author

weissi commented Nov 4, 2019

basically a non-sync prefixed version of

public func syncShutdown() throws {
switch self.eventLoopGroupProvider {
case .shared:
self.isShutdown.store(true)
return
case .createNew:
if self.isShutdown.compareAndExchange(expected: false, desired: true) {
try self.eventLoopGroup.syncShutdownGracefully()
} else {
throw HTTPClientError.alreadyShutdown
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants