Vonage / vonage-python-sdk

Vonage Server SDK for Python. API support for Voice, SMS, WhatsApp, Verify (2FA), Video Meetings and more.
https://developer.vonage.com
Apache License 2.0
194 stars 118 forks source link

Setting optional arguments such as : max retries, pool-connections, pool maxsize #210

Closed Nath-B closed 2 years ago

Nath-B commented 2 years ago

Max retries, pool connections, and pool maxsize arguments are very often used and adjusted within multi-threaded applications.

Currently in 2x vonage, max_retries is by default set to 0, which is not recommended for production-based applications since no retry mechanism is implemented. This leads to failures in multi-threaded environments. We set this variable to 3 and give option for users to set other arguments (they are optional and their default values are HTTPAdapter's default values).

Nath-B commented 2 years ago

@maxkahan do not hesitate to review :) thanks !

maxkahan commented 2 years ago

HI @Nath-B I've discussed this with colleagues, and we're of the agreement that this can be merged without changes.

The method you're modifying shouldn't strictly be called directly in its current incarnation, but I agree that the commit you made adds value in the way you proposed. For that reason, I'm happy to merge in this form.

I would note that this module will be refactored when time allows, so a future major release will change how this object is called, though I agree that having these options does add value.

Nath-B commented 2 years ago

thanks @maxkahan !