更清晰的同步异步接口
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 432
- PR merge metrics
- No merged PRs in 30d
Description
旧版统一接口:void Put (RowMutation* mu);
新版同步接口:ErrorCode Put (RowMutation* mu);
新版异步接口:void Put (RowMutation* mu, CallbackFunc cb_func, void* cb_ctx);
兼容性:
因为旧版接口跟新版同步接口一样,所以用户的旧代码会调用新版的同步接口,为了保证兼容,同步接口的实现里面要判断RowMutation的GetCallback和GetContext是否非NULL,如果是的话,调用异步接口,并直接返回OK。
用户的旧代码会通过RowMutation的GetError得到错误码,因此新版同步接口也要将错误码Set到RowMutation中。
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the Put overloads and the RowMutation methods named in the issue: GetCallback, GetContext, GetError, and the error setter. Trace how synchronous and asynchronous calls currently share implementation, then verify that legacy calls remain compatible, callback-bearing mutations use the asynchronous path, and synchronous errors are stored on RowMutation. Add or update focused tests for these behaviors if the existing test structure identifies where they belong.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api, backend, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100