Skip to content

Make the input HTTPClient required #17

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

Conversation

czechboy0
Copy link
Collaborator

Motivation

We previously defaulted the HTTPClient to .init(), but that's not correct as it was never getting shut down.

Modifications

Removed the default value, which is a breaking change, so will need to be rolled out with 0.3.0.

Result

No more crashing clients on dealloc.

Test Plan

N/A

/// let transport = AsyncHTTPClientTransport()
/// let httpClient = HTTPClient()
/// defer {
/// try! httpClient.syncShutdown()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh I'd use that too, but in this example I need to shut down from a defer, and I don't think I can call async functions from there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, I didn't see the full example in the unexpanded diff. Yeah, its annoying but that's probably the way to go for this example.

@czechboy0 czechboy0 closed this Sep 18, 2023
@czechboy0
Copy link
Collaborator Author

Going with this one instead: #18

@czechboy0 czechboy0 deleted the hd-readd-required-client branch September 18, 2023 07:12
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