Skip to content

Conversation

@kwaazaar
Copy link

Currently the webrequest object (.net object used to make the actual api calls) does not have a request timeout explicitly set, thus using the default timeout of 60 seconds. However, for many calls this is too much, especially when a service using the client itself uses a smaller timeout. This PR makes it possible to configure this request timeout on a Client object.

@samwierema
Copy link
Contributor

@kwaazaar thanks for opening a pull request (and sorry it's taken so long for us to reply). We'll review your code next week and get back to you with any feedback we have.

Copy link
Contributor

@epels epels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kwaazaar, thank you for submitting this PR! It looks great! I have one minor comment, and please remove the changes unrelated to the timeout (.gitignore and csharp-rest-client.sln). Thanks.


public RestClient(string accessKey, IProxyConfigurationInjector proxyConfigurationInjector)
: this(HttpsRestMessagebirdComEndpoint, accessKey, proxyConfigurationInjector)
: this(accessKey, proxyConfigurationInjector, TimeSpan.FromSeconds(60))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be great to have a TimeSpan DefaultTimeout field to use here - then we can reuse that below when actually setting the timeout in PrepareRequest. What do you think?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants