Skip to content

rpc: allow setting a Timeout for client requests #2010

@melekes

Description

@melekes

Refs #1772 (comment)

        // Timeout specifies a time limit for requests made by this
        // Client. The timeout includes connection time, any
        // redirects, and reading the response body. The timer remains
        // running after Get, Head, Post, or Do return and will
        // interrupt reading of the Response.Body.
        //
        // A Timeout of zero means no timeout.
        //
        // The Client cancels requests to the underlying Transport
        // using the Request.Cancel mechanism. Requests passed
        // to Client.Do may still set Request.Cancel; both will
        // cancel the request.
        //
        // For compatibility, the Client will also use the deprecated
        // CancelRequest method on Transport if found. New
        // RoundTripper implementations should use Request.Cancel
        // instead of implementing CancelRequest.
        Timeout time.Duration

Metadata

Metadata

Assignees

No one assigned

    Labels

    C:rpcComponent: JSON RPC, gRPC

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions