sendgrid / python-http-client

Twilio SendGrid's Python HTTP Client for calling APIs
https://sendgrid.com
MIT License
125 stars 101 forks source link

Support timeout #21

Closed georgeyk closed 6 years ago

georgeyk commented 7 years ago

A work-in-progress fix for https://github.com/sendgrid/python-http-client/issues/20

We can use timeout in the client scope, so it will apply the given timeout value for all requests and/or by specific request call (the request timeout will take precedence over the client timeout configuration`).

# client timeout
python_http_client.Client(host=host, timeout=3)
response = client.search.get(...)  # timeout=3
response = client.search.get(..., timeout=5)  # will use timeout=5

I need to improve the tests, but I'll wait for the initial feedback.

SendGridDX commented 7 years ago

CLA assistant check
All committers have signed the CLA.

georgeyk commented 7 years ago

Looking at https://travis-ci.org/sendgrid/python-http-client/jobs/281829725 it is not related with the changes in PR (or at least, not obviously related - something in distutils :cry: ).

thinkingserious commented 7 years ago

We are removing support for v2.6, so no worries :)

georgeyk commented 6 years ago

Any feedback here ? I was looking to the tests, but I'm not sure if this change is entirely testable in the current structure.

thinkingserious commented 6 years ago

Hi @georgeyk,

My apologies, this issue is still on my backlog for review. I hope to review it soon.

With Best Regards,

Elmer

thinkingserious commented 6 years ago

Hello @georgeyk,

This PR finally came up on my backlog :)

I tried to fix the conflicts, but GitHub is not happy :( Do you mind fixing them? Otherwise, this PR looks good to go.

With Best Regards,

Elmer

georgeyk commented 6 years ago

Hi @thinkingserious,

I'm sorry about the late response, but I finally managed to update the PR.

thinkingserious commented 6 years ago

Thanks @georgeyk!

thinkingserious commented 6 years ago

Hello @georgeyk,

Thanks again for the PR!

We appreciate your contribution and look forward to continued collaboration. Thanks!

Team SendGrid DX