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)
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)