Skip to content

Commit

Permalink
Suggest using a session for the lifetime of an app
Browse files Browse the repository at this point in the history
As suggested in #789
  • Loading branch information
brettcannon committed Feb 21, 2016
1 parent 4b1f707 commit f14b3d1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/client_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ Client Session

Client session is the recommended interface for making HTTP requests.

Session encapsulates *connection pool* (*connector* instance) and
supports keepalives by default.
Session encapsulates a *connection pool* (*connector* instance) and
supports keepalives by default. Unless you are connecting to a large,
unknown number of different servers over the lifetime of your
application, it is suggested you use a single session for the
lifetime of your application to benefit from connection pooling.

Usage example::

Expand All @@ -31,7 +34,7 @@ Usage example::

.. versionadded:: 0.17

The client session supports context manager protocol for self closing.
The client session supports the context manager protocol for self closing.

.. class:: ClientSession(*, connector=None, loop=None, cookies=None,\
headers=None, skip_auto_headers=None, \
Expand Down

0 comments on commit f14b3d1

Please sign in to comment.