NativeScript / NativeScript/napi-android
Add ability to Share Native Object Instances between Main and Worker Runtimes
未关闭
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 33
- 派生
- 3
- PR 合并指标
- 30 天内没有已合并 PR
描述
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);
}
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定文件或测试。首先跟踪所示 createNativeHandle 和 resolveNativeHandle 入口点周围 Main 与 Worker 的运行时消息路径,然后确定 Java-backed 对象如何在不同运行时之间保持有效。完成的标准是示例可以将 native String 从 Main 发送到 Worker,并在那里安全地解析它。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, cpp, java, javascript, typescript
- 领域
- mobile-dev, tooling
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100