Replies: 2 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Those were our plans too - however, the (C++) code that handles runtime creation is quite volatile now as we're still tweaking the pipeline. Is JS API sufficient for you now, or do you need C++ as well? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone 👋
Now that worklets is becoming a standalone package we are reevaluating the usage of worklets over our worklets-core package to be used in VisionCamera (and other libraries).
The one thing we see missing to make this happen is an Api that allows us to pass our own owned thread.
In VisionCamera we need to execute on certain DispatchQueues (Swift) / Coroutines (Kotlin).
However, we see that worklets is creating the thread on its own here:
react-native-reanimated/packages/react-native-worklets/Common/cpp/worklets/Tools/AsyncQueue.cpp
Line 9 in 2af7a20
One approach we have in mind to make this happen is to allow for a new argument to be passed to
createWorkletRuntime
, which could beHostObject
that implementsworklets::AsyncQueue
.We make
worklets::AsyncQueue
abstract/virtual, and you can provide a default implementation.We then can take care on our side of implementing / bridging this to our DispatchQueues / Coroutines.
Beta Was this translation helpful? Give feedback.
All reactions