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 option to configure Finch pool :pool_max_idle_time #436

Merged

Conversation

jonatanklosko
Copy link
Contributor

In some cases, a long-running app may want to make requests to arbitrary URLs (e.g. specified by the user). By default finch would start a separate pool for each host and keep it indefinitely, but this can be configured with the :pool_max_idle_time option.

Initially I wanted to just use a custom finch pool and do Req.new(finch: TransientFinchPool), however we also use :connect_options, and these cannot be used together. Hence, I'm proposing to add the Finch pool option. Thoughts?

@wojtekmach wojtekmach merged commit cdb7228 into wojtekmach:main Nov 25, 2024
2 checks passed
@wojtekmach
Copy link
Owner

Thank you!

@jonatanklosko jonatanklosko deleted the jk-finch-pool-idle-timeout branch November 25, 2024 10:38
@wojtekmach
Copy link
Owner

wojtekmach commented Nov 25, 2024

As an aside, we probably should allow passing any Finch option (and let Finch fail if it's mistyped), I'll think about it some more.

@jonatanklosko
Copy link
Contributor Author

I was thinking that maybe it should be nested pool_options: [pool_max_idle_time: 60_000] and allow any values, but since there are already different options converted to pool options, I am not sure.

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

Successfully merging this pull request may close these issues.

2 participants