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

Preventing IAM signature requests from blocking the main thread. #32

Merged
merged 2 commits into from Jun 28, 2018
Merged

Preventing IAM signature requests from blocking the main thread. #32

merged 2 commits into from Jun 28, 2018

Conversation

stefanceriu
Copy link
Contributor

The current implementation of AWSAppSyncHTTPNetworkTransport's send methods block the main thread waiting for the AWSSignatureV4Signer's credentials provider to fetch access tokens. This is particularly noticeable under poor network conditions.

This PR wraps the URLSessionDataTasks in a Cancellable AWSAppSyncHTTPNetworkTransportOperation and returns early so it doesn't block anymore. The internal dataTask will be populated later as a result of the AWSTask chain.

@stefanceriu stefanceriu changed the title Preventing IAM signature request from blocking the main thread. Preventing IAM signature requests from blocking the main thread. Jun 5, 2018
@rohandubal
Copy link
Contributor

Thanks for the PR @stefanceriu !

I will have a look at this and reply back.

Copy link
Contributor

@rohandubal rohandubal left a comment

Choose a reason for hiding this comment

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

Thanks again for the PR! I will merge this with next release.

@stefanceriu
Copy link
Contributor Author

Awesome, thank you too. We'll add a small commit to it soon to support cancellations while requesting tokens.

@rohandubal
Copy link
Contributor

That would be great! Will wait for it 😄

@rohandubal rohandubal merged commit f009d5d into awslabs:master Jun 28, 2018
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.

None yet

2 participants