Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(Worklets): runOnRuntimeSync #8224

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

Open
skusnierz wants to merge 8 commits into main
base: main
Choose a base branch
Loading
from @skusnierz/run-on-runtime-sync

Conversation

@skusnierz
Copy link
Contributor

@skusnierz skusnierz commented Sep 10, 2025
edited by github-actions bot
Loading

Summary

This PR :

  • adds runOnRuntimeSync API function
  • adds runOnRuntimeSync type tests and runtime test
  • adds docs for runOnRuntimeSync function

Test plan

Screenshot 2025年09月10日 at 16 07 46 Screenshot 2025年09月10日 at 16 07 54

if (globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) {
return WorkletsModule.runOnRuntimeSync(
workletRuntime,
makeShareableCloneOnUIRecursive(() => {
Copy link
Member

@piaskowyk piaskowyk Sep 11, 2025

Choose a reason for hiding this comment

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

Why on worker runtime we want to call makeShareableCloneOnUIRecursive? 🤔

Copy link
Contributor Author

@skusnierz skusnierz Sep 16, 2025

Choose a reason for hiding this comment

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

This is an old name, it was created before the functionality of creating custom Worklet Runtimes was added. This function should be called makeShareableCloneOnWorkletRuntimeRecursive, but as we discussed yesterday with @tjzel, we will not change it

Comment on lines +7 to +8
`runOnRuntimeSync` lets you run a [workletized](/docs/fundamentals/glossary#to-workletize) function synchronously on a [Worker Runtime](/docs/fundamentals/glossary#worker-worklet-runtime---worker-runtime).
It might preempt the Runtime where it's called from the thread (it's blocking).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`runOnRuntimeSync` lets you run a [workletized](/docs/fundamentals/glossary#to-workletize) function synchronously on a [Worker Runtime](/docs/fundamentals/glossary#worker-worklet-runtime---worker-runtime).
It might preempt the Runtime where it's called from the thread (it's blocking).
`runOnRuntimeSync` lets you run a [workletized](/docs/fundamentals/glossary#to-workletize) function synchronously on a [Worker Runtime](/docs/fundamentals/glossary#worker-worklet-runtime---worker-runtime). It's blocking - meaning that it can preempt the runtime from a thread that's currently executing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tjzel tjzel tjzel approved these changes

@piaskowyk piaskowyk Awaiting requested review from piaskowyk

At least 1 approving review is required to merge this pull request.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /