Skip to content

Commit

Permalink
Merge pull request #796 from brettcannon/patch-1
Browse files Browse the repository at this point in the history
Suggest using a session for the lifetime of an app
  • Loading branch information
asvetlov committed Feb 22, 2016
2 parents 4b1f707 + f14b3d1 commit e3e1369
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 e3e1369

Please sign in to comment.