Replies: 1 comment
-
|
Hi @Bialson. AFAIK Expo is currently working on an experimental iteration of a feature of using Expo Modules on multiple runtimes - I assume that means that Expo libraries like If you had a library that, for instance, operate via a HostObject in JavaScript (which is not a TurboModule) you could copy it to a Worklet Runtime and use it there, from another thread. Unfortunately I don't know whether such a library exists. However, if it would indeed exist, then you could use it somewhat like this: import {createFileManager} from 'some-library';
import {createWorkletRuntime, scheduleOnRuntime} from 'react-native-worklets';
const fileManager = createFileManager(); // a HostObject
const runtime = createWorkletRuntime();
scheduleOnRuntime(() => {
'worklet';
fileManager.readBlob('/bigBlob'); // fileManager is implicitly copied to another runtime here
}); |
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I'm currently implementing a custom file reader for
tus-js-clientto address Memory issues on Android. The standard Blob implementation throws anOutOfMemoryerror when handling files larger than 100 MB.To optimize performance and avoid overhead on the main JS thread, I'm considering moving the file reading logic to a worklet. Does anyone know if it's possible to use
expo-file-system(or a similar library) within a worklet to read raw bytes?Any insights or architectural advice would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions