@@ -337,26 +337,26 @@ LoopFun(LoopFun, ClientRef).
337337
338338### Use the default pool
339339
340- To reuse a connection globally in your application you can also use a
341- socket pool. On startup, hackney launches a pool named default. To use it
342- do the following:
340+ Hackney uses socket pools to reuse connections globally. By default,
341+ hackney uses a pool named ` default ` . You may want to use different
342+ pools in your application which allows you to maintain a group of
343+ connections. To use a different pool, do the following:
343344
344345``` erlang
345346
346347Method = get ,
347348URL = <<" https://friendpaste.com" >>,
348349Headers = [],
349350Payload = <<>>,
350- Options = [{pool , default }],
351+ Options = [{pool , mypool }],
351352{ok , StatusCode , RespHeaders , ClientRef } = hackney :request (Method , URL , Headers ,
352353 Payload , Options ).
353354```
354355
355- By adding the tuple ` {pool, default} ` to the options, hackney will use
356- the connections stored in that pool.
357-
358- You can also use different pools in your application which allows
359- you to maintain a group of connections.
356+ By adding the tuple ` {pool, mypool} ` to the options, hackney will use
357+ the connections stored in that pool. The pool gets started automatically
358+ the first time it is used. You can also explicitly configure and start
359+ the pool like this:
360360
361361``` erlang
362362
@@ -379,7 +379,11 @@ hackney_pool:stop_pool(PoolName).
379379> Note: Sometimes you want to disable the default pool in your app
380380> without having to set the client option each time. You can now do this
381381> by setting the hackney application environment key ` use_default_pool `
382- > to false.
382+ > to false. This means that hackney will not use socket pools unless
383+ > specifically requested using the ` pool ` option as described above.
384+ >
385+ > To disable socket pools for a single request, specify the option
386+ > ` {pool, false} ` .
383387
384388### Use a custom pool handler.
385389
0 commit comments