Skip to content
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

[Analysis] Specialize HTTP client for Apple platform to fix the connection issue while running in the background #1086

Closed
2 tasks
jbelkins opened this issue Aug 17, 2023 · 2 comments
Assignees
Labels
feature-request A feature should be added or improved. needs-discussion This issue/PR requires more discussion with community. needs-investigation
Milestone

Comments

@jbelkins
Copy link
Contributor

jbelkins commented Aug 17, 2023

Describe the feature

Enable the CRT HTTP client to continue handling events in the background on Apple platform clients.

The standard event handling mechanism used by the CRT HTTP client (kqueue) is not fully supported on Apple platforms (i.e. native iOS/iPadOS, tvOS, macOS applications). Using the CRT HTTP client as-is on Apple platforms will result in broken connections if the application is not in the active state for the entire duration of the connection; this is a severe limitation for most use cases, especially for mobile devices where connection speeds are limited and users are restricted to one foreground app at a time.

To remedy this limitation, an alternative event handling mechanism ("dispatch queues") must be used on Apple platforms, since dispatch queues continue to handle events as expected throughout the application lifecycle. The CRT HTTP client will be modified to use the correct event handling mechanism when building for the platforms that require it.

Use Case

To enable efficient, background HTTP communications via the AWS SDK for Swift.

Proposed Solution

Use Apple platform-native event handling on Apple platforms, instead of CRT's current event handling which is based on POSIX threads.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@jbelkins jbelkins added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. needs-discussion This issue/PR requires more discussion with community. needs-investigation labels Aug 17, 2023
@jbelkins jbelkins added this to the GA milestone Aug 17, 2023
@jbelkins jbelkins self-assigned this Aug 17, 2023
@jbelkins jbelkins removed the needs-triage This issue or PR still needs to be triaged. label Aug 21, 2023
@smivij smivij changed the title Specialize HTTP client for Apple platform Specialize HTTP client for Apple platform to fix the connection issue while running in the background Sep 22, 2023
@smivij smivij changed the title Specialize HTTP client for Apple platform to fix the connection issue while running in the background [Analysis] Specialize HTTP client for Apple platform to fix the connection issue while running in the background Sep 25, 2023
@jbelkins
Copy link
Contributor Author

@JonathanHenson has created this branch in aws-c-io which provides the necessary event queue support, but requires cleanup prior to merge:

awslabs/aws-c-io@main...network_framework_integration

@smivij smivij changed the title [Analysis] Specialize HTTP client for Apple platform to fix the connection issue while running in the background [Analysis and Implementation] Specialize HTTP client for Apple platform to fix the connection issue while running in the background Sep 26, 2023
@smivij smivij changed the title [Analysis and Implementation] Specialize HTTP client for Apple platform to fix the connection issue while running in the background [Analysis] Specialize HTTP client for Apple platform to fix the connection issue while running in the background Sep 26, 2023
@waahm7
Copy link

waahm7 commented Nov 7, 2023

I have completed an analysis of the PR and discussed it with Jonathan Henso. The PR requires cleanup and a few quirks that need to be sorted out. We can pick up the implementation task in Q1 2024. It won't require anything on the Swift SDK side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. needs-discussion This issue/PR requires more discussion with community. needs-investigation
Projects
None yet
Development

No branches or pull requests

2 participants