Skip to content

Add context to dropbox http requests #108

@pi-tau

Description

@pi-tau

Why is this feature valuable to you? Does it solve a problem you're having?
We have a service that executes requests to dropbox on given PubSub events. We want to stop all running http connections when an event is nacked or times out. Passing an event context to the dropbox requests will be a solution to the problem.

Describe the solution you'd like
One solution would be to add a context parameter to all client methods and pass that context to the http request. However, this solution modifies the methods' signatures and would not be backwards compatible.
Another solution would be to modify the arg struct parameter passed to the client method.
For example the files.Upload method accepts a CommitInfo struct. We could add a context field to that struct.

We could also provide a pull request with our changes if needed.

Describe alternatives you've considered
As an alternative we have concidered cloning the Go SDK locally and adding the modifications ourselves. However this modification seems generic enough to be added in the (un)official SDK. I believe that a lot of people would benefit from this.

Additional context
Abandoning http connections without closing them would cause connection leak.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions