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

A prototype of ThreadContextElement on k/js and k/native #3325

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eymar
Copy link

@eymar eymar commented Jun 17, 2022

It's a mere copy/paste from jvm sources + 2 common tests to showcase how ThreadContextElement can be used (similar to Compose Runtime needs).

It's desirable to have some common CoroutineContext.Element similar to ThreadContextElement:

Specifically, such a CoroutineContext.Element would have 2 common things with ThreadContextElement:
a function e.g. onResume(context: CoroutineContext): S, which is invoked before the coroutine in the specified context is resumed
a function e.g. onSuspend(context: CoroutineContext, oldState: S), which is invoked after the coroutine in the specified context is suspended

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.

1 participant