Add ability to Share Native Object Instances between Main and Worker Runtimes
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- android, cpp, java, javascript, typescript
- Domain
- mobile-dev, tooling
Research direction
No files or tests are named. Start by tracing the Main and Worker runtime message paths around the shown createNativeHandle and resolveNativeHandle entry points, then determine how a Java-backed object can remain valid across runtimes. Done means the example can send a native String from Main to Worker and resolve it there safely.
Written by the indexing model from the issue text.
Description
Both Worker and Main JS runtime instances use the same Java environment hence the native objects can be shared between the two.
Main:
const nativeObject = new java.lang.String("string");
const worker = new Worker(...);
worker.postMessage({
myNativeString: globalThis.createNativeHandle(nativeObject)
});
Worker:
globalThis.onmessage = (message) => {
const nativeObject = globalThis.resolveNativeHandle(message.myNativeString);
}
- Dominant language
- C++
- Stars
- 33
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NativeScript/napi-android
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
NativeScript/napi-android#31 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
NativeScript/napi-android#30 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
NativeScript/napi-android#28 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
NativeScript/napi-android#25 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
NativeScript/napi-android#20 ·
All issues in NativeScript/napi-android
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Component: GLib
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Mute ydb/tests/functional/dstool/test_canonical_requests.py.Test.test_group_take_snapshot in main Openai_reviewed
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ydb-platform/ydb#53974 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google/libultrahdr#485 ·