Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add context to dropbox http requests #108

Open
pi-tau opened this issue Feb 15, 2022 · 1 comment
Open

Add context to dropbox http requests #108

pi-tau opened this issue Feb 15, 2022 · 1 comment

Comments

@pi-tau
Copy link

pi-tau commented Feb 15, 2022

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.

@stoyaneft
Copy link

Contexts are really necessary for production use. It would be great if they are added here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants