refactor: revisit the triplicated buffer implementations across the tokio / embassy / wasm adapters
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- backend, embedded-iot
调研方向
Read docs/design/035-review-followups-deferred.md §2.3 and docs/design/038-technical-debt-and-simplification-review.md §2.3 / §3.2, then compare the buffer read paths in the three adapter files named in the issue. Check whether the documented tripwire has been hit by the late-join snapshot and record.get changes. Done means either recording a re-confirmation in 035 and closing the issue, or writing the shared core implementation design described in 038.
由索引模型根据 Issue 内容生成。
描述
Problem
The three runtime adapters each hand-build the same three buffer semantics (SPMC ring, single-latest, mailbox):
| File | Lines | Of which inline tests start at |
|---|---|---|
aimdb-tokio-adapter/src/buffer.rs |
1,634 | line 611 |
aimdb-embassy-adapter/src/buffer.rs |
963 | line 628 |
aimdb-wasm-adapter/src/buffer.rs |
757 | line 478 |
Each also carries a high density of feature gates (32, 29 and 26 cfg(feature …) occurrences respectively). This is the largest structural duplication left in the workspace: a behavioural fix or a new buffer feature has to be written and tested three times, and parity between them is only enforced by tests.
Prior decisions
This is not new:
docs/design/038-technical-debt-and-simplification-review.md§2.3 / §3.2 proposed one portable buffer implementation in core and estimated about 2,000 lines net removed (breaking for adapter authors only).docs/design/035-review-followups-deferred.md§2.3 decided "keep, with a tripwire" for the buffer-ext trait triplication.
So this issue is a request to re-check that decision, not to overturn it by default.
Suggested work
- Check whether the tripwire condition recorded in 035 §2.3 has been hit since (e.g. by the recent late-join snapshot and
record.getchanges, which touched buffer read paths). - If it has, or if the cost has grown, write the design for a shared core implementation as 038 §3.2 sketched.
- If not, record the re-confirmation in 035 and close this.
Notes
Line counts are from the tree at d9c7be0. I did not diff the three implementations line by line, so the amount of truly shareable code is the 038 estimate, not something I measured.
- 主要语言
- Rust
- 星标
- 101
- 派生
- 20
- 平均合并
- 2 小时 33 分钟
- 30 天内合并 PR
- 90
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aimdb-dev/aimdb 的其他 Issue
-
🏷️ good first issue enhancement
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
Panic on live viewport resize when unstyled elements exist in display: none subtree可能已有人在做 @GoCoder7 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
DioxusLabs/blitz#1488 ·
维护者通常 1 天内回复
-
S-Needs triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
vectordotdev/vrl#2042 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复