fc5ebb72b9
No longer uses CPS. We also found and documented a potential bug in the way we deal with disablePcloudData during detachDeviceReq.
1.3 KiB
1.3 KiB
Adapter Awaiters
This directory contains coroutine/awaitable adapters that wrap callback-driven or event-driven APIs.
Placement rules
- Put wrappers for external APIs in provider-specific subdirectories.
- Examples:
boostAsio/,opencl/,liburing/.
- Examples:
- Put wrappers for SMO/internal APIs in
smo/. - Do not place adapter awaiters in feature folders like
stimBuffApis/*orsmocore/*unless they are strictly private to one translation unit.
Tree layout
include/adapters/
README.md
boostAsio/
<boost asio adapter awaiters>
opencl/
<OpenCL adapter awaiters>
smo/
cpsCallbackAReq.h
livoxProto1CpsAwaiters.h
<other SMO/internal callback adapters>
Design guidelines
- Name adapter awaiter wrapper functions
get<fnName>AReqAwaiter(), where<fnName>is the wrapped CPS/API request symbol with its library prefix removed and each_-delimited segment Pascal-cased (e.g.livoxProto1_getOrCreateDeviceReq→getGetOrCreateDeviceReqAReqAwaiter()). - Keep adapters small and single-purpose; but unify where possible to reduce code duplication.
- Make result types explicit for multi-argument callbacks.
- Resume coroutines on a caller-specified executor/io_service.
- Avoid embedding business logic in adapters.