react-native icon indicating copy to clipboard operation
react-native copied to clipboard

introduce PriorityRuntimeExecutor

Open philIip opened this issue 1 year ago • 2 comments

Summary: Changelog: [Internal]

the goal is to allow userland to pass down scheduler priorities to the CallInvoker.

in bridge, we currently have RuntimeSchedulerCallInvoker. though this supports priorities, we cannot reuse this as is because it is unbuffered. currently JS invocations in bridgeless are (mostly) buffered.

in bridgeless, we currently have BridgelessJSCallInvoker

in this change, i introduce a new function type, PriorityRuntimeExecutor, that in addition to the runtime callback, has a priority argument. i hook this up to the cxx infra where we will instead call scheduleTask with a priority rather than scheduleWork if we receive a priority from userland.

i also introduced a new API from the cxx ReactInstance, called getPriorityRuntimeExecutor, which will allow us to keep the current getBufferedRuntimeExecutor intact which will allow for a iterative migration, but also make sure that both of these APIs share the same buffer.

Differential Revision: D56455633

philIip avatar Apr 23 '24 06:04 philIip

This pull request was exported from Phabricator. Differential Revision: D56455633

facebook-github-bot avatar Apr 23 '24 06:04 facebook-github-bot