chengxilo commented on code in PR #2964:
URL: https://github.com/apache/iggy/pull/2964#discussion_r2954674425


##########
foreign/go/client/tcp/tcp_core.go:
##########
@@ -256,18 +258,32 @@ func (c *IggyTcpClient) write(payload []byte) (int, 
error) {
 }
 
 // do sends the command to the Iggy server and returns the response.
-func (c *IggyTcpClient) do(cmd command.Command) ([]byte, error) {
+func (c *IggyTcpClient) do(ctx context.Context, cmd command.Command) ([]byte, 
error) {
        data, err := cmd.MarshalBinary()
        if err != nil {
                return nil, err
        }
-       return c.sendAndFetchResponse(data, cmd.Code())
+       return c.sendAndFetchResponse(ctx, data, cmd.Code())
 }
 
-func (c *IggyTcpClient) sendAndFetchResponse(message []byte, command 
command.Code) ([]byte, error) {
+func (c *IggyTcpClient) sendAndFetchResponse(ctx context.Context, message 
[]byte, command command.Code) ([]byte, error) {
+       if ctx == nil {
+               return nil, errors.New("nil context")
+       }
+       if err := ctx.Err(); err != nil {

Review Comment:
   solved.



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

Reply via email to