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

Response parsing now done on the provided handlerQueue #539

Conversation

Valpertui
Copy link
Contributor

@Valpertui Valpertui commented May 9, 2019

If the cache policy is .fetchIgnoringCacheData, the send method is executed on the caller queue/thread. ( see _fetch method) .
It also means that the response parsing is done on the caller queue/thread which can be the main queue (and so, blocking it).

This change executes the parsing on the provided handler queue every time.

@martijnwalraven martijnwalraven merged commit 444f1b3 into apollographql:master May 13, 2019
@cltnschlosser
Copy link
Contributor

Why would you want the response parsing to be done on the handler queue? In most cases that will be the main queue, which will block UI updates. See my now conflicted PR which moved response parsing to a background queue #505

@Valpertui
Copy link
Contributor Author

That’s your choice to use the main queue as handler queue, which is a terrible idea in my opinion, but in my case handler queue is always a background queue

@Valpertui
Copy link
Contributor Author

After looking at your PR, I agree that your version is better, since it use a dedicated queue for response parsing and not the user provided one (which will probably be the wrong one for beginners or inexperienced users since the library use the mainqueue as default queue for the ‘handlerQueue’, I suspect that it’s something that should be changed, but it would break so many apps using Apollo directly from a ViewController)

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.

3 participants