Commit 8582c0dd authored by Jason Madden's avatar Jason Madden

Tweak docs for gevent.pool. Fixes #1279.

parent f77ab4ab
:mod:`gevent.pool` -- Managing greenlets in a group
===================================================
.. automodule:: gevent.pool
:members:
:undoc-members:
:inherited-members:
.. module:: gevent.pool
.. autoclass:: gevent.pool.Group
:members:
:inherited-members:
.. automethod:: __len__
.. automethod:: __contains__
.. autoclass:: gevent.pool.PoolFull
:members:
.. autoclass:: gevent.pool.Pool
:members:
......@@ -71,7 +71,7 @@ master_doc = 'contents'
# General information about the project.
project = u'gevent'
copyright = u'2009-2015, gevent contributors'
copyright = u'2009-2018, gevent contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
......
......@@ -289,10 +289,15 @@ class Group(GroupMappingMixin):
they can be tested to see if they contain a greenlet, and they know the
number (len) of greenlets they are tracking. If they are not tracking any
greenlets, they are False in a boolean context.
.. attribute:: greenlet_class
Either :class:`gevent.Greenlet` (the default) or a subclass.
These are the type of
object we will :meth:`spawn`. This can be
changed on an instance or in a subclass.
"""
#: The type of Greenlet object we will :meth:`spawn`. This can be changed
#: on an instance or in a subclass.
greenlet_class = Greenlet
def __init__(self, *args):
......@@ -524,10 +529,14 @@ class Pool(Group):
maximum count of active greenlets that will be allowed in
this pool. A few values have special significance:
* ``None`` (the default) places no limit on the number of
greenlets. This is useful when you need to track, but not limit,
greenlets, as with :class:`gevent.pywsgi.WSGIServer`. A :class:`Group`
may be a more efficient way to achieve the same effect.
* `None` (the default) places no limit on the number of
greenlets. This is useful when you want to track, but not limit,
greenlets. In general, a :class:`Group`
may be a more efficient way to achieve the same effect, but some things
need the additional abilities of this class (one example being the *spawn*
parameter of :class:`gevent.baseserver.BaseServer` and
its subclass :class:`gevent.pywsgi.WSGIServer`).
* ``0`` creates a pool that can never have any active greenlets. Attempting
to spawn in this pool will block forever. This is only useful
if an application uses :meth:`wait_available` with a timeout and checks
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment