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

@@ -17,6 +17,8 @@ type (
ServerMiddlewaresConf = internal.ServerMiddlewaresConf
// StatConf defines the stat config.
StatConf = internal.StatConf
// ServerSpecifiedTimeoutConf defines specified timeout for gRPC method.
ServerSpecifiedTimeoutConf = internal.ServerSpecifiedTimeoutConf
// A RpcClientConf is a rpc client config.
RpcClientConf struct {
@@ -45,6 +47,8 @@ type (
// grpc health check switch
Health bool `json:",default=true"`
Middlewares ServerMiddlewaresConf
// setting specified timeout for gRPC method
SpecifiedTimeouts []ServerSpecifiedTimeoutConf `json:",optional"`
}
)