DMwangnima commented on code in PR #2454:
URL: https://github.com/apache/dubbo-go/pull/2454#discussion_r1387403783


##########
protocol/triple/client.go:
##########
@@ -143,14 +143,14 @@ func newClientManager(url *common.URL) (*clientManager, 
error) {
                panic(fmt.Sprintf("Unsupported serialization: %s", 
serialization))
        }
 
-       // todo:// process timeout
-       // consumer config client connectTimeout
-       //connectTimeout := config.GetConsumerConfig().ConnectTimeout
+       // set timeout
+       timeout := url.GetParamDuration(constant.TimeoutKey, "")

Review Comment:
   > The specific method level timeout (optional) passed in with `ctx` in 
`TripleInvoker.invoke(ctx)`, then to 
`clientManager.callUnary/callClientStream()`. If timeout presents in ctx, then 
it will be used as the timeout value; If not, the default value calculated here 
by `timeout := url.GetParamDuration(constant.TimeoutKey, "")` will be used.
   > 
   > Is the above process right?
   
   Yes, that is. The ```ctx``` used by users would have highest priority. It is 
more ideal for uses to use ```ctx``` to specify timeout for method level since 
they can use ```cancel``` function directly.



-- 
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]

Reply via email to