Skip to content

Commit

Permalink
Merge pull request #446 from spinettaro/master
Browse files Browse the repository at this point in the history
improved documentation around disabling hackney pool
  • Loading branch information
edgurgel authored Aug 3, 2021
2 parents 65e94a9 + 9505f90 commit e165675
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,20 @@ From the already linked [hackney's readme](https://github.com/benoitc/hackney#us

> `timeout` is the time we keep the connection alive in the pool, `max_connections` is the number of connections maintained in the pool. Each connection in a pool is monitored and closed connections are removed automatically.
#### Disabling pool

If you don't want to use a pool for a single http request, you can do it by passing an option:
```elixir
HTTPoison.get("httpbin.org/get", [], hackney: [pool: false])
```

If you want to disable the usage of the pool for every request you can do it by adding this to your environment configuration:
```elixir
config :hackney, use_default_pool: false
```

You can find a little explanation here [hackney's readme](https://github.com/benoitc/hackney#use-the-default-pool).

#### Pools as supervised processes

A third option is to add the pool as part of your supervision tree:
Expand Down

0 comments on commit e165675

Please sign in to comment.