Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[coro_rpc][fix] keep protocol compatible/use context<T>::tag() instead o… #555

Merged
merged 4 commits into from
Jan 3, 2024

Conversation

poor-circle
Copy link
Collaborator

…f set_tag&get_tag/use coro_rpc::err_code instead of coro_rpc::errc

What is changing

  1. Closes Why not try to keep the RPC protocol compatible #554 to keep compatible of rpc protocol. Now user's error code will be put in payload not in rpc_head.
  2. use std::any& context<T>::tag() instead of set_tag/get_tag
  3. the error type now change to coro_rpc::err_code to help error handling like:
  auto ec= client.connect();
  if (ec) {
     //....
  }
  1. add example for context<T>::response_error & context<T>::tag

…f set_tag&get_tag/use coro_rpc::err_code instead of coro_rpc::errc
include/ylt/coro_rpc/impl/protocol/coro_rpc_protocol.hpp Outdated Show resolved Hide resolved
src/coro_rpc/examples/base_examples/client.cpp Outdated Show resolved Hide resolved
src/coro_rpc/examples/base_examples/rpc_service.cpp Outdated Show resolved Hide resolved
src/coro_rpc/examples/file_transfer/rpc_service.cpp Outdated Show resolved Hide resolved
include/ylt/coro_rpc/impl/errno.h Outdated Show resolved Hide resolved
include/ylt/coro_rpc/impl/errno.h Outdated Show resolved Hide resolved
@qicosmos qicosmos self-requested a review January 3, 2024 03:55
Copy link
Collaborator

@qicosmos qicosmos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@poor-circle poor-circle merged commit 3d8252f into alibaba:main Jan 3, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why not try to keep the RPC protocol compatible
2 participants