Skip to content

[Feature] Finch tagged pool enhancement #367

Description

@meox

Finch now support 2 different kind of pools:

children = [
{Finch,
name: MyConfiguredFinch,
pools: %{
:default => [size: 10, count: 2],
"https://hex.pm" => [size: 32, count: 8]
}}
]

the catch all pool (:default) and an exact match on a specific scheme+host+port

should be great to have a way to select a pool also using a tag:

children = [
{Finch,
name: MyConfiguredFinch,
pools: %{
:api => [size: 10, count: 2],
:default => [size: 10, count: 2],
"https://hex.pm" => [size: 32, count: 8]
}}
]

In this case:

Uses the :api tagged pool

request = Finch.build(:get, "https://api.example.com/users", [], nil, pool_tag: :api)
Finch.request(request, MyTaggedFinch)

this works for any host

Uses the :api tagged pool also for a different host

request = Finch.build(:get, "https://api.meteo.com", [], nil, pool_tag: :api)
Finch.request(request, MyTaggedFinch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions