-
Notifications
You must be signed in to change notification settings - Fork 11
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 Configurable options
for Req.Request
in HttpClient
#48
Comments
@shijithkjayan no worries, just make a pull request and we'll merge it. |
One thing I wanted to add to the PR is testing the Initially, I wanted to use Mox to do the testing, but I don't think that's how you want to test things here, which is why I haven't done that either. |
Awesome @shijithkjayan, thank you! I have few questions as I looked at the PR:
|
Hi @jaeyson, yes the test is the only missing piece. I have verified that the changes haven't broken any existing functionalities. But the lack of test coverage for the changes I added is what that worries me |
Got it @shijithkjayan, will do. |
@jaeyson Can you please create a new release? Or do you want me to submit another PR with the updated changelog? |
@shijithkjayan thanks for the nudge, I will do the release 👌🏾. I'll add the test for request function on the next release. |
Description:
Hi @jaeyson,
I would like to request an enhancement to the
ExTypesense.HttpClient
module to allow developers to configure theoptions
forReq.Request
through the application configuration. This would provide greater flexibility and allow developers to tailor the HTTP client to their specific needs.For example, it would be beneficial to configure the
options
like so:This change would enable developers to leverage the various options available in
Req.Request
, such as::finch
- the name of the Finch pool.:connect_options
- dynamically starts (or re-uses already started) Finch pool with the given connection options.:inet6
- if set to true, uses IPv6.:pool_timeout
- pool checkout timeout in milliseconds.:receive_timeout
- socket receive timeout in milliseconds.:unix_socket
- if set, connect through the given UNIX domain socket.:finch_private
- a map or keyword list of private metadata to add to the Finch request.:finch_request
- a function that executes the Finch request.For more details on the available options, please refer to the Req documentation.
Reason for Request:
The primary reason for this request is to provide developers with the ability to configure the
HttpClient
to meet their specific requirements. By exposing theoptions
forReq.Request
as a configurable value, developers can easily adjust the behavior of the HTTP client without modifying the library code.Use Case:
One specific use case for this enhancement is the need to use a different Finch adapter other than the default one started by Req. For instance, in a scenario where an application has multiple Finch pools configured for different services, a developer might want to specify a particular Finch pool for the
HttpClient
to use. This can be achieved by configuring theoptions
as follows:In this example,
MyApp.CustomFinch
is a custom Finch pool that the developer has configured with specific connection options or other settings that differ from the default Finch pool. This flexibility allows the developer to optimize the HTTP client's performance and behavior according to the application's unique requirements.Thank you for considering this enhancement. I believe it will greatly improve the flexibility and usability of the
ExTypesense
library.The text was updated successfully, but these errors were encountered: