From f14b3d1cba8e62dfb9286f6bc6d8cb65a03841bc Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sun, 21 Feb 2016 09:51:17 -0800 Subject: [PATCH] Suggest using a session for the lifetime of an app As suggested in #789 --- docs/client_reference.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/client_reference.rst b/docs/client_reference.rst index c8294ef373a..36a38a7520f 100644 --- a/docs/client_reference.rst +++ b/docs/client_reference.rst @@ -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:: @@ -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, \