feat: support the specified timeout of rpc methods (#2742)

Co-authored-by: hanzijian <hanzijian@52tt.com>
Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
This commit is contained in:
vankillua
2023-10-25 21:01:57 +08:00
committed by GitHub
parent 2a335c7608
commit 842c4d81cc
10 changed files with 378 additions and 29 deletions

View File

@@ -110,3 +110,8 @@ func DontLogClientContentForMethod(method string) {
func SetClientSlowThreshold(threshold time.Duration) {
clientinterceptors.SetSlowThreshold(threshold)
}
// WithTimeoutCallOption return a call option with given timeout.
func WithTimeoutCallOption(timeout time.Duration) grpc.CallOption {
return clientinterceptors.WithTimeoutCallOption(timeout)
}