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

Remove intrinsics usage in RibCoroutineWorker #627

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

psteiger
Copy link
Contributor

@psteiger psteiger commented Nov 30, 2023

Currently, we need to build both bindJob and unbindJob synchronously (CoroutineScope.bind is not suspending and must return a handle with both jobs).

In order to synchronously get an instance of bindJob, we start the unbindJob coroutine undispatched (bindJob is a child of unbindJob, so we need an instance of unbindJob to create an instance of bindJob).

This commit changes dispatching logic to a much simpler one that does not require usage of intrinsics: after saving bindJob, we properly dispatch in a cancellable way by simply launching a new coroutine.

This commit changes dispatching logic to a much simpler one that does not require usage of intrinsics.

In order to synchronously get an instance of `bindJob`, we start the `unbindJob` coroutine undispatched (`bindJob` is a child of `unbindJob`, so we need an instance of `unbindJob` to create an instance of `bindJob`).

After saving `bindJob`, we properly dispatch in a cancellable way by simply `launch`ing a new coroutine.
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