thorneliu commented on PR #2273:
URL: https://github.com/apache/brpc/pull/2273#issuecomment-1596394405
> > > Hi,
> > > Since `Retry_backoff_policy` or `Backoff_retry_policy` **IS A** Retry
policy, it is not a good idea that both policies exist in channel,
> > > ```
> > > , retry_policy(NULL)
> > > , retry_backoff_policy(NULL)
> > > ```
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > It is better that retry_backoff_policy inherits basic interface in a
manner of :
> > > ```
> > > class BackoffRetryPolicy : public RetryPolicy {
> > > bool DoRetry(const Controller* controller) const {
> > > // details in backoff policy
> > > }
> > > }
> > > ```
> >
> >
> > @thorneliu Good idea. Maybe These virtual functions can be added to
RetryPolicy with default implementation that the retry backoff feature is
turned off. In a manner of:
> > ```c++
> > class RetryPolicy {
> > public:
> > virtual ~RetryPolicy();
> > virtual bool DoRetry(const Controller* controller) const = 0;
> > virtual int32_t GetBackoffTimeMs(const Controller* controller, int
nretry,
> > int64_t remaining_rpc_time_ms)
const { return 0; }
> > virtual bool CanRetryBackoffInPthread() const { return false; }
> > };
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > `FixedRetryBackoffPolicy` and `JitteredRetryBackoffPolicy` inherit
`RpcRetryPolicy` which implements the default rpc retry policy.
>
> @thorneliu New implementationhas been updated. Could you spare some tine
to review it again and offer any additional input?
Hi, 不好意思没有及时回复
我觉得最好是RetryPolicy的接口不添加 GetBackoffTimeMs 或CanRetryBackoffInPthread
我们是否可以做到,
```
fooPolicy = new brpc::fooPolicy(arg1, arg2).
channeloptions.retryPolicy = fooPolicy;
````
然后类似 BackoffTimeMs 这样的细节封装在各自的policy内部。基本的rpcRetryPolicy接口只暴露一个简单的
`DoRetry()` 方法?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]