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

Suspend support in interceptors #7908

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

yschimke
Copy link
Collaborator

@yschimke yschimke commented Jun 24, 2023

A quick riff on #7904 to provoke discussion

Detection is by two mechanisms

  1. Use a thread local set in AsyncCall.executeOn, if the interceptor strictly on the same thread, this works. But not swapping dispatchers.
  2. Use chain.callFactory which never actually enqueues.

We should look at what is possible on SuspendingInterceptor, if we say that this support relies on using it, and all frameworks (wire, retrofit) are suspending, then maybe we can carry some information in the CoroutineContext to detect this, and pick it back up again in executeAsync?

@yschimke yschimke requested a review from swankjesse June 24, 2023 15:19
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

1 participant