Open robnewton opened 1 year ago
You can't do asynchronous things within worklets since they don't run the event loop as far as I know.
However, I didn't expect that async/await syntax is not supported in worklets. The error message indicates that worklets don't support generator syntax which is emitted as a transpilation result of async/await.
That makes sense but I was hoping it would just execute synchronously. In this scenario I don't need it to be asynchronous since it's in another thread, I just need to call something which relies on that syntax.
Is it possible to use async/await within Worklets?
I'm trying to make calls to asynchronous functions outside of the function tagged with the worklet keyword? As a simple example, is it possible to use the Expo FileSystem async functions like copyFileAsync() from within a worklet?
When tried, I get errors like this: