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

【腾讯犀牛鸟开源课题实战】对接mysql sdk(主框架变动部分) #192

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions trpc/client/service_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ class ServiceProxy {
const ClientCodecPtr& GetClientCodec() { return codec_; }

/// @brief Stop used resources by service proxy (thread-safe).
void Stop();
virtual void Stop();

/// @brief Destroy used resources by service proxy (thread-safe).
void Destroy();
virtual void Destroy();

/// @brief Pre-allocate a connection, used for scenarios that require fixed connections for data transmission
/// (thread-safe).
Expand Down Expand Up @@ -118,9 +118,18 @@ class ServiceProxy {
/// in the options for non-direct connection models.
const std::string& GetServiceName();

// Collect statistics on the service proxy and report them to the tvar.
void ProxyStatistics(const ClientContextPtr& ctx);

// Used to determine if the request has timed out. Returns true if timed out, false if normal.
bool CheckTimeout(const ClientContextPtr& context);

/// @brief Use the proxy option parameters to set the context.
void FillClientContext(const ClientContextPtr& context);

// Routing selection interface, retrieve IP and port based on service name and store in ctx.
bool SelectTarget(const ClientContextPtr& context);

/// @brief Run filters by filter point.
int RunFilters(const FilterPoint& point, const ClientContextPtr& context);

Expand All @@ -138,9 +147,6 @@ class ServiceProxy {
// Check if the tvar variable required for statistical has been created, and create it if it has not been created.
void PrepareStatistics(const std::string& service_name);

// Collect statistics on the service proxy and report them to the tvar.
void ProxyStatistics(const ClientContextPtr& ctx);

// Determine if pipeline is supported.
bool SupportPipeline(const std::shared_ptr<ServiceProxyOption>& option);

Expand All @@ -156,9 +162,6 @@ class ServiceProxy {
// Execute IO tracking for rpcz.
FilterStatus RunIoFilters(const FilterPoint& point, const std::any& msg) noexcept;

// Routing selection interface, retrieve IP and port based on service name and store in ctx.
bool SelectTarget(const ClientContextPtr& context);

// Get connection type by config
ConnectionType GetClientConnectType();

Expand All @@ -169,9 +172,6 @@ class ServiceProxy {
// plugin.
void InitSelectorFilter();

// Used to determine if the request has timed out. Returns true if timed out, false if normal.
bool CheckTimeout(const ClientContextPtr& context);

// Error handling, it will set error information to context.
void HandleError(const ClientContextPtr& context, int ret, std::string&& err_msg);

Expand Down
2 changes: 1 addition & 1 deletion trpc/client/service_proxy_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void ServiceProxyManager::SetOptionDefaultValue(const std::string& name, std::sh
if (option->name_space.empty()) {
option->name_space = TrpcConfig::GetInstance()->GetGlobalConfig().env_namespace;
}

// If callee_name is not set, set it to name of proxy.
if (option->callee_name.empty()) {
option->callee_name = name;
Expand Down
Loading