Skip to content

context.Context support #11

Open
@abhinav

Description

@abhinav

Overview

Go client libraries typically accept a context.Context as the first
argument in all outgoing function calls. The context carries deadline and
other information across API boundaries. See also https://blog.golang.org/context.

Popular examples are,

Context also allows orchestrating cancelation, especially with concurrent
operations. Support for this is already built into http.Client.

Implementation

All methods that make an outgoing request would have to accept a
context.Context as their first argument and plumb it over to http.Client
with req.WithContext(ctx), likely in buildRequest or prepareRequest.

Because this will involve a breaking change to the API, it should probably be
bundled with any other breaking changes you have planned.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions