Add the missing BRPC_WITH_UBRING Bazel configuration, wire it through
the library and example targets, and document the supported build
commands.
Enable RDMA and UBRING in CI jobs whose all-options configurations did
not exercise those features. Run both feature suites in the existing
Bazel unit-test jobs and enable RDMA in the Make unit-test job.
Use unsigned literals for UBRING atomic counter operations to match the
counter type and avoid template deduction failures on stricter
compilers.
Signed-off-by: Zhengwei Zhu <141622927+ZhengweiZhu@users.noreply.github.com>
* build(cxx): align all builds on a C++14 baseline
CMake, Make, tests, tools, and examples now require C++14 so every supported build path shares the same minimum language level. The compiler checks and user-facing documentation reflect that baseline.
* fix(test): keep cores scoped to the failing test
Clear prior cores before each test binary. A passing death test can leave a core that would otherwise be used to diagnose an unrelated later failure.
* revert src/butil/type_traits.h
* cputime optimize for arm64
Update src/butil/time.cpp
modify using __attribute__((constructor)) and merge init_invariant_cpu_freq to inside function read_invariant_cpu_frequency
* Add the macro switch BUTIL_USE_CPU_FREQUENCY while preserving the original default behavior for ARM64
* 1、Activation options: CMake -DWITH_CPU_FREQUENCY=ON, Bazel --define BUTIL_USE_CPU_FREQUENCY=true, script argument --with-cpu-frequency.
2、Disabled by default for consistent legacy behavior.
* fix compile failed
---------
Co-authored-by: seekdwh <dongweihao@huawei.com>
Example CMakeLists duplicated the same dependency discovery and link
setup. Move that into brpc_example_find_common_deps in
BrpcExample.cmake, migrate MySQL and other examples to use it, and
implement the helper as a macro so CMAKE_PREFIX_PATH, include paths,
and DYNAMIC_LIB propagate to the caller scope.
Example-specific deps stay local (e.g. readline/ncurses/thriftnb for
MySQL, gperftools for redis/http). LINK_SO behavior is unchanged.
* add ubring transport
* fix the bug for ub ring transport
* fix the bug for ub ring transport and other
* add the license for ub transport
* Modifying the variable naming style
* optimize the log message and some field name
* fix some bug for ubring
* add some log ubring endpoint
* add todo
* fix the bug for handshake for ub endpoint
* fix the bug for client ub endpoint
* optimize the iobuf file code
* modify the log level
* fix the declare_shm_ubs define not found bug
* add the timer_mgr support for macos and format code style
* fix the bug for macos epoll
* fix the timespece bug
* adaptor the itimerspec for macos platform
* optimize the cmakelist config
* add the ubring docs for ubring transport
* modify some file name and directory structure
* modify some code style and optimize code logical
* add the cmake ubshm transport ci/testing
* add the dependency header
* bug fix the code
* Fix UB shm allocation cleanup crashes (#11)
Co-authored-by: 郭业昌 <lvpengfei@MacBook-Air.local>
* remove the brpc_ubshm_unittest
* Found and fixed two stability issues (#13)
* 修复ubring server端关闭连接coredump问题
* 修复PollIn/PollOut解引用已释放Socket指针的问题
PollIn/PollOut通过ep->_socket(裸指针)读取data socket,当data socket
被销毁时该指针悬空,导致Socket::Address读到垃圾id触发SIGSEGV。
改为存储_socket_id(SocketId),用Address获取引用计数的Socket,
并在整个回调期间持有该引用,避免解引用悬空指针。
* 修复client非正常退出导致UBRING shm残留的问题
client被强杀(SIGTERM/崩溃/OOM)时teardown没跑完,localShm(_C)的
shm_unlink未执行,导致/dev/shm残留_C文件。server的remoteShm只munmap
不unlink(正确),无法清理client的名字。
在握手ESTABLISHED时(client/server都确认对方已mmap自己的localShm)
立即unlink localShm名字。此时对端已持有mmap引用,unlink只删名字不
影响通信;进程任意时刻退出都不会残留文件名。
* Address chenBright's review: use English comments and BAIDU_CACHELINE_ALIGNMENT
- Convert all Chinese comments in ubshm to English (per chenBright's
'Please use English' on ub_endpoint.cpp:723, ub_ring.cpp:337,
shm_ubs.cpp:316, and similar)
- Replace __attribute__((aligned(64))) with BAIDU_CACHELINE_ALIGNMENT
in ubr_msg.h (per chenBright's comment on ubr_msg.h:41)
- Remove unnecessary TODO comment in ub_ring.cpp:551 (per chenBright's
'Unnecessary comments, please delete')
* Remove unused lock macros in thread_lock.h
Per chenBright's review, the functions and macros defined in
thread_lock.h are largely unused. Verified usage across ubshm:
- LOCK_GUARD / UnlockMutex: 8 call sites in shm_ubs.cpp and
ub_ring_manager.cpp, kept.
- SPIN_LOCK_GUARD, R_LOCK_GUARD, W_LOCK_GUARD, SEMAPHORE_WAIT_GUARD,
SEMAPHORE_WAIT_GUARD_WITH_CLOSE and their helper functions
(UnlockSpinLock, UnlockRWLock, PostSem, PostSemWithClose): 0 call
sites, removed.
* Apply chenBright's review on timer_mgr globals
Per chenBright's review on timer_mgr.cpp:32-37:
- Add explicit default values to uninitialized globals
(g_total_timer_num=0, g_max_system_fd=0, g_epoll_execute_thread=0,
g_timer_module_initialized=0)
- Rename globals to snake_case (g_epollFd -> g_epoll_fd,
g_totalTimerNum -> g_total_timer_num, g_timerFdCtxMap ->
g_timer_fd_ctx_map, maxSystemFd -> g_max_system_fd,
g_epollExecuteThread -> g_epoll_execute_thread,
g_timerModuleInitialized -> g_timer_module_initialized)
- maxSystemFd also gains the g_ prefix to match global naming style
Also fix the missing std:: qualifier on atomic_fetch_sub/add/load
(per chenBright's earlier comment on timer_mgr.cpp:80).
* Change CloseTimerFd fd type from uint32_t to int
Per chenBright's review on timer_mgr.cpp:399 (uint32_t -> int).
fd is a system file descriptor; POSIX APIs use int and -1 denotes an
invalid fd, which uint32_t cannot represent. Changed the CloseTimerFd
signature (header + definition) and removed the now-unnecessary
(uint32_t) casts at the two call sites.
* Use BAIDU_LIKELY/BAIDU_UNLIKELY instead of custom __builtin_expect
Per chenBright's review on common.h:27. Rather than redefine the
macros with __builtin_expect directly, forward LIKELY/UNLIKELY to
brpc's standard BAIDU_LIKELY/BAIDU_UNLIKELY (from butil/compiler_specific.h).
The 122 call sites keep using LIKELY()/UNLIKELY() unchanged; only the
macro bodies change, preserving semantics.
* Add unit tests for UBShmEndpoint
Per chenBright's request to add unit tests for UBShmTransport in this
PR (rather than a follow-up).
Adds test/brpc_ubring_unittest.cpp with tests covering the public
interface of UBShmEndpoint under the g_skip_ub_init=true mode (which
skips real shared-memory/poller setup):
- construct_and_destruct: lifecycle safety
- is_writable_false_when_skip_init: skip-mode behavior
- reset_is_idempotent: Reset() is safe to call repeatedly
The file follows the brpc_*_unittest.cpp naming convention so it is
auto-collected by test/CMakeLists.txt's file(GLOB). Verified: compiles,
links, and all 3 tests pass (g++ 15.2, C++17, gtest, BRPC_WITH_UBRING=ON).
* Rewrite UBShmEndpoint unit tests with real coverage
Per chenBright's feedback that the previous tests were too simple and
did not cover the main methods.
Source changes to enable testing:
- Move HelloMessage struct declaration from ub_endpoint.cpp to
ub_endpoint.h so tests can access it
- Expose private members under #ifdef UNIT_TEST (precedent:
butil/containers/stack_container.h) so tests can call
AllocateClientResources without -Dprivate=public (which breaks
GCC 15 + new libstdc++ <any>/<sstream>)
Tests (9, all passing on Ubuntu 26.04 g++ 15.2 C++17 gtest):
HelloMessageTest (5): serialize/deserialize roundtrip, network byte
order verification, uint64 max boundary, full shm_name, toString
UBShmEndpointTest (4): construct, real IPC shm
AllocateClientResources (g_skip_ub_init=false), reset cleanup, reset
idempotency
* rename the variable to snake_case style
---------
Co-authored-by: YeChang Guo <52730608+YChange01@users.noreply.github.com>
Co-authored-by: 郭业昌 <lvpengfei@MacBook-Air.local>
Co-authored-by: gure <740684863@qq.com>
* build(cmake): keep modern CMake policy compatibility
Raise the minimum CMake version range to 3.16...3.28 so CMake 4.x no longer treats the project as relying on removed pre-3.5 policy compatibility. The range preserves a conservative 3.16 runtime floor while documenting policy validation through 3.28.
* build(cmake): modernize target-scoped CMake configuration
Move shared compile definitions, include paths, options, and link dependencies onto interface targets so top-level, src, tools, tests, and standalone examples consume consistent build settings without relying on global directory state.
Examples now share a small CMake helper, and the gtest download path is updated to configure with modern CMake while keeping downloaded gtest headers ahead of Homebrew's C++17-only installation.
* feat(mysql): clean-room MySQL authentication codec
Clean-room implementation of the MySQL connection-phase authentication handshake,
derived from the public MySQL protocol documentation with no GPL lineage:
mysql_native_password and caching_sha2_password scrambles, HandshakeV10/
HandshakeResponse41 codec, and length-encoded integer/string plus packet-header
wire helpers. Handles the lenenc NULL (0xFB) marker and rejects an oversize
auth_response.
* feat(mysql): full MySQL text protocol with transactions and prepared statements
Port the MySQL protocol client (issue #2093) onto the clean-room auth codec and
protobuf 3.21 (NonreflectableMessage): COM_QUERY text protocol, interactive
transactions via connection affinity, and prepared statements. Wire
caching_sha2_password (fast-auth, full-auth RSA, and secure-transport cleartext)
into the live client. Fix the lenenc 9-byte length marker in pack_encode_length
(0xFD -> 0xFE) per the MySQL protocol spec.
* test(mysql): clean-room integration tests + prepared-stmt error fix + Controller cleanup
- Add clean-room integration tests (transactions, prepared statements, pooled
connection concurrency, connection-type) run against a self-spawned mysqld.
- Fix: a failed COM_STMT_PREPARE now returns the ERR packet to the caller and keeps
the connection alive, instead of closing the socket.
- Warn when a prepared statement runs on a 'short' connection (re-prepares on every
execute; prefer 'pooled').
- Replace Controller's mysql-specific _mysql_stmt with a generic opaque per-RPC slot
so no protocol type leaks onto the shared Controller.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(mysql): consolidate sources under policy/mysql/; drop inherited images
Move all MySQL sources (mysql.*, mysql_command/reply/common/transaction/
statement*, mysql_protocol.*, mysql_authenticator.*) into src/brpc/policy/mysql/
alongside the clean-room auth codec; update all includes, build globs, and
install rules. Remove three benchmark images inherited from the #2093 port and
the doc section referencing them.
No behavior change: full build green; all 19 mysql unit/integration tests pass;
a 30-case standalone end-to-end run was independently verified against mysqld.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(mysql): address code-review findings (binary protocol, auth, edge cases) + ASF headers
- Binary DATETIME/TIME: gate the microsecond bytes on the packet length, not the
column's declared decimals (over-read / result-set desync).
- COM_STMT_SEND_LONG_DATA: frame stmt_id/param_id inside the packet; fix chunk offset.
- COM_STMT_EXECUTE: emit the trailing 0-length packet for 16MiB-aligned payloads.
- OK/EOF status & warnings: decode via mysql_uint2korr (big-endian safe).
- Row NULL-bitmap: arena-allocate instead of a stack VLA; cap column_count.
- Auth: bounds-check the parsed auth string; size-bound StringPiece uses.
- Prepared stmt: prune stale per-socket stmt_id map entries; count only real '?'
placeholders (skip quotes/comments).
- MysqlResponse::Clear and MysqlRequest copy/Swap: reset/copy all members.
- Controller::ResetPods: release _bind_sock on controller reuse.
- Standardize mysql file license headers to the ASF form; clarify auth comment.
All 19 unit/integration tests still pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(mysql): address review findings — license header, flag typo, header-global, doc/comment drift
- example/mysql_c++/mysql_go_press.go: add ASF Apache-2.0 license header
(the last file failing the License Check; other 6 already had headers).
- mysql_common.{h,cpp}: move the MysqlCollations map definition out of the
header into the .cpp behind an `extern` declaration, so each translation
unit no longer gets its own copy (C++11-safe; avoids the header-defined
global flagged in review).
- mysql_statement.{cpp,inl.h}: rename the misspelled gflag
mysql_statment_map_size -> mysql_statement_map_size (user-facing name).
- docs/cn/mysql_client.md: prepared statements ARE supported now — drop the
stale "不支持Prepared statement".
- brpc_mysql_connection_type_unittest.cpp: rewrite the stale header comment
that described a removed "MustError" test; the prepared-statement path now
transparently re-prepares under CONNECTION_TYPE_SHORT and succeeds, matching
the actual PreparedStatementUnderShortRePreparesAndSucceeds test.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(mysql): use the standard ASF license header on new example/test files
The new MySQL example sources and brpc_mysql_unittest.cpp carried the old
"Copyright (c) Baidu, Inc." Apache-2.0 header, which skywalking-eyes (the
repo's License Check, configured copyright-owner = Apache Software Foundation)
does not accept — so all 7 files failed the gate. Replace with the canonical
ASF header used by the other 549 sources in the tree, and drop the stale
Baidu copyright/date attribution lines. Verified locally with
`license-eye -c .licenserc.yaml header check`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(mysql): add diagnostic error logs on silent failure paths
Extend the failure-path logging from the auth codec to the full client
protocol. Parsers and request/response handlers returned false/0/nullptr
silently on malformed wire data, truncated packets, bad state, or missing
prepared statements, giving no clue why a query/connection failed. Add a
LOG(ERROR) at each silent failure path naming the function and the concrete
cause.
- mysql_auth_handshake/packet.cpp: handshake + lenenc codec failure paths
(truncated <field>, pre-4.1 server, reserved 0xFF marker, length mismatch).
- mysql.cpp: request command/param guards.
- mysql_reply.cpp: result-set parse (column/row/error packet truncation,
arena alloc failure, bad binary-row header).
- mysql_protocol.cpp: serialize/process type + serialization failures.
- mysql_statement.cpp: statement-id lookup misses (not-prepared / stale conn).
Logic unchanged — logs inserted only. Normal control-flow returns
(need-more-data, lenenc NULL 0xFB, short-connection no-cache) are not logged.
mysql_authenticator.cpp and mysql_transaction.cpp already logged every
failure path and were left unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(mysql): demote non-fatal diagnostic logs to LOG(WARNING)
Tune the severity of the failure-path logs. LOG(ERROR) is reserved for
total failures — handshake/connection corruption, authentication failure,
out-of-memory, and fundamental request/response type or serialization
misuse. Operational and statement-data failures are demoted to
LOG(WARNING):
- mysql_auth_packet.cpp: lenenc int/string/header decode failures (these
fire during normal resultset parsing).
- mysql.cpp: request command/param API guards.
- mysql_reply.cpp: column/row/field/ERR-packet truncation (statement data).
The arena out-of-memory and Auth::Parse auth-plugin failures stay ERROR.
- mysql_statement.cpp: prepared-statement-id lookup misses (recoverable,
trigger a re-prepare).
handshake parsing and the protocol serialize/process type checks remain
LOG(ERROR). Severity-only change; messages and logic unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(test): make AuthCase a C++11 aggregate so push_back{...} compiles
CI compiles unittests with -std=c++0x (C++11), where a class with a default
member initializer is not an aggregate, so g_auth_cases.push_back({...})
fails to compile. Drop the default member initializer on AuthCase::use_ssl;
all init sites pass it explicitly. Mirrors the same fix on the #3310 codec
branch.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(mysql,ci): run integration tests against a real CI-provisioned mysqld
The MySQL integration tests were not exercising a live server in CI:
- Merge master to pick up #3323, which installs mysql-server in the
install-essential-dependencies action used by the unittest lanes, so the
mysqld binary is present for the self-spawning test/mysql/* suites.
- Delete the legacy test/brpc_mysql_unittest.cpp: it hardcoded an external
host (db4free.net) with embedded credentials and asserted on connect
failure (no skip), so it timed out and hard-failed in CI. The
test/mysql/*_integration suites supersede it, spawning a throwaway local
mysqld and GTEST_SKIP-ing when none is available (the redis precedent).
- Build the test/mysql/* suites in the make lane: extend test/Makefile's
source glob and add a mysql/-prefixed link rule; add the subdir to
run_tests.sh with nullglob so it runs them.
- Bazel: build one cc_test per mysql test file via generate_unittests
instead of globbing them all into a single brpc_mysql_test target, which
duplicated main() and the FLAGS_mysql_* definitions (ld: duplicate
symbol). Drop the per-file main()s so every suite relies on gtest_main,
matching brpc_redis_unittest; tag the server-spawning suites
external+local so bazel runs them unsandboxed with the real mysqld.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* address review comments: bind-sock flag, non-copyable response, naming
- Controller: store the mysql-transaction BindSockAction in two bits of
_flags (FLAGS_BIND_SOCK_RESERVE / FLAGS_BIND_SOCK_USE) via
set_bind_sock_action()/bind_sock_action(), instead of a dedicated member,
per review. No behavior change.
- MysqlResponse: make it explicitly non-copyable (= delete copy ctor and
assignment) and turn the previously no-op MergeFrom into a hard
CHECK-failure, so an accidental copy/CopyFrom is caught instead of
silently dropping parsed replies.
- MysqlRequest: rename the trivial getters get_tx()/get_stmt() to
tx()/stmt() per review.
- ControllerPrivateAccessor: add set_mysql_statement_type() as a clearly
named alias over the pipelined_count slot the mysql protocol reuses, and
call it from the mysql protocol instead of set_pipelined_count() directly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(mysql): move unittests from mysql/ subdir into test/
Move all seven mysql unittests (auth handshake/packet/scramble,
connection_type, pool_concurrency, prepared/txn integration) and the
test-plan doc out of test/mysql/ into test/, per review on
apache/brpc#3310.
The existing brpc_*_unittest glob in the Makefile and CMakeLists.txt now
picks them up, so both revert to master with no mysql-specific lines. In
BUILD.bazel they likewise join the brpc_unittests glob; the five tests
that fork a real mysqld keep their ["external", "local"] tags by folding
those entries into that target's per_test_tags instead of a separate
mysql target.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(mysql): drop run_tests.sh mysql/ subdir entry after move
The mysql unittests now live in test/ and match the existing
brpc*unittest glob in run_tests.sh, so revert the script to master. The
removed mysql/brpc*unittest entry needed `shopt -s nullglob` to skip a
missing subdir, but CI runs the script under `sh` (dash), where shopt is
absent; nullglob stayed off and the now-empty glob was executed as a
literal path, exiting 127.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Fix backup/retry call hang: default-initialize bind_sock_action
The new bind_sock_action member of Controller::Call had no in-class default,
and the Call(Call*) copy constructor used for backup requests and retries did
not initialize it in its member-init list. The backup call therefore read an
indeterminate value in Controller::Call::OnComplete, which branches on it
before the normal pool-return / SetFailed path; when the garbage matched
BIND_SOCK_RESERVE/BIND_SOCK_USE the backup call's socket was diverted to
_bind_sock or held instead of returned, leaving the in-flight RPC unconcluded
and hanging ChannelTest.backup_request until the test timeout (nondeterministic,
hence flaky-looking).
Give the member an in-class default initializer (BIND_SOCK_NONE) so every Call
construction path inherits it; a backup/retry never inherits transaction
connection-affinity. This closes the whole class of "new init path forgets the
member" rather than the single copy-ctor instance.
* Initialize Call::bind_sock_action explicitly in every constructor
Per review: drop the in-class default initializer for Call::bind_sock_action
and set it explicitly in each Call constructor (the copy ctor used for
backup/retry) and Call::Reset(). Leaving it uninitialized was the cause of the
backup/retry-request hang; explicit per-constructor init keeps every path safe.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Address review: remove redundant comments and dead code, move _bind_sock.reset() to ResetNonPods()
* Remove commented-out code in mysql_stmt example
---------
Co-authored-by: rajvarun77 <287367605+rajvarun77@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add The transport layer to support communication protocols of different device vendors.
* Refine the SocketMode name style and clean some unused code
* Refine Transport Debug method param and RdmaTransport WaitEpollOut code
* format the code, remove indentation for top class and variables in new file
* review code
---------
Co-authored-by: wenjiecn <3252896864@qq.com>
* Implemented Couchbase binary protocol support
* added support for single connection type for couchbase
* removed unnecessary cout statements
* added protocol code for helo packet
* fixed vbucketID code for identification, fixed add and get functions
* Added test cases for threaded get and add functions
* Added Error Handling code and made upsert and delete examples
* added makefile for example/couchbase_c++
* fixed bugs in couchbase header files
* Added License and formatted to google c++ norms
* fixed bugs, added support for collections and added couchbase_client.md
* fixed license issue
* added custom logic for caching collectionIDs
* added caching of collection manifests
* Added example code for multithreaded demonstration
* updated CMake
* Abstracted CRUD operations
* Added pipeline/batching support
* commented unused variables
* Updated support for C++17
* fixed some issue.
* Using Mutex instead of shared lock to support c++11
* Formatted code to google c++ format
* Introduced local cache per-instance of CouchbaseOperations and added functionality to handle server side manifest updates.
* Delete MODULE.bazel.lock
Unnecessary file
* Fixed bugs in local collection cache and collection refresh logic
* remove recurring statements
* Fixed bugs/repetitive calls to refreshing manifest on server
* Formatted function/variable naming scheme and formatted code in c++ google format
* removed unnecessary code
* updated comments
* updated comments
* updated documentation
* updated documentation
* updated documentation
* updated documentation
* Updated documentation
* Updated documentation
* Update documentation
* Added features and fixed bugs in multithreaded environment
Using connection_groups to differentiate between connections across CouchbaseOperations instances to different buckets.
Renamed CollectionManifestTracker class to CollectionManifestManager and all the related functionality inside it as before refreshing method was outside this class
Added two different authenticate method authenticate(not secure) and authenticateSSL(secure)
* Updated multithreaded and single threaded code.
Added an example where a single instance is being shared across the threads when operating on single bucket.
* updated documentation
updated the documentation on thread safe operations and fixed small small discrepancies.
* removed commented code and updated readme to have links for cluster download certificate
* removed unused code.
* Added traditional bRPC coding approach
Traditional bRPC coding approach doesn't uses high level functions but provides more control to the user
fixed formatting issues.
fixed the bug in couchbase.cpp where logic to check the cache is empty was inverted
* updated couchbase_example.md
* added unit test cases
* removed using namespace std from couchbase.h
* restored original CMakeLists.txt
* feat: batch create and accept stream
* fix protobuf 22.5 compilation error related to thread_local in MacOS
* refine style
* modify code based on the code review feedback and add more tests
modify code based on the code review feedback and add more tests
* Support c++20 coroutine
* Fix CI UT failed
* Add example coroutine Makefile
* Add usercode_in_coroutine flag
* Add coroutine document
* Add experimental namespace for coroutine
* call_after_rpc_resp
* fix function name & add examples & add ut
* fix mistake
* fix compile error
* fix compile error
* update ut
* complete ut
* update ut
* modify function name
---------
Co-authored-by: yuncheng <yuncheng@pinduoduo.com>