@@ -65,10 +65,10 @@ class ServiceProxy {
65
65
const ClientCodecPtr& GetClientCodec () { return codec_; }
66
66
67
67
// / @brief Stop used resources by service proxy (thread-safe).
68
- void Stop ();
68
+ virtual void Stop ();
69
69
70
70
// / @brief Destroy used resources by service proxy (thread-safe).
71
- void Destroy ();
71
+ virtual void Destroy ();
72
72
73
73
// / @brief Pre-allocate a connection, used for scenarios that require fixed connections for data transmission
74
74
// / (thread-safe).
@@ -118,9 +118,18 @@ class ServiceProxy {
118
118
// / in the options for non-direct connection models.
119
119
const std::string& GetServiceName ();
120
120
121
+ // Collect statistics on the service proxy and report them to the tvar.
122
+ void ProxyStatistics (const ClientContextPtr& ctx);
123
+
124
+ // Used to determine if the request has timed out. Returns true if timed out, false if normal.
125
+ bool CheckTimeout (const ClientContextPtr& context);
126
+
121
127
// / @brief Use the proxy option parameters to set the context.
122
128
void FillClientContext (const ClientContextPtr& context);
123
129
130
+ // Routing selection interface, retrieve IP and port based on service name and store in ctx.
131
+ bool SelectTarget (const ClientContextPtr& context);
132
+
124
133
// / @brief Run filters by filter point.
125
134
int RunFilters (const FilterPoint& point, const ClientContextPtr& context);
126
135
@@ -138,9 +147,6 @@ class ServiceProxy {
138
147
// Check if the tvar variable required for statistical has been created, and create it if it has not been created.
139
148
void PrepareStatistics (const std::string& service_name);
140
149
141
- // Collect statistics on the service proxy and report them to the tvar.
142
- void ProxyStatistics (const ClientContextPtr& ctx);
143
-
144
150
// Determine if pipeline is supported.
145
151
bool SupportPipeline (const std::shared_ptr<ServiceProxyOption>& option);
146
152
@@ -156,9 +162,6 @@ class ServiceProxy {
156
162
// Execute IO tracking for rpcz.
157
163
FilterStatus RunIoFilters (const FilterPoint& point, const std::any& msg) noexcept ;
158
164
159
- // Routing selection interface, retrieve IP and port based on service name and store in ctx.
160
- bool SelectTarget (const ClientContextPtr& context);
161
-
162
165
// Get connection type by config
163
166
ConnectionType GetClientConnectType ();
164
167
@@ -169,9 +172,6 @@ class ServiceProxy {
169
172
// plugin.
170
173
void InitSelectorFilter ();
171
174
172
- // Used to determine if the request has timed out. Returns true if timed out, false if normal.
173
- bool CheckTimeout (const ClientContextPtr& context);
174
-
175
175
// Error handling, it will set error information to context.
176
176
void HandleError (const ClientContextPtr& context, int ret, std::string&& err_msg);
177
177
0 commit comments