Skip to content

Commit

Permalink
remove gaiohttp worker (#1971)
Browse files Browse the repository at this point in the history
* remove gaiohttp worker

worker is deprecated and won't work on latest version.
  • Loading branch information
benoitc committed Jan 24, 2019
1 parent 2ea5fbd commit 97a4580
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 418 deletions.
27 changes: 5 additions & 22 deletions docs/source/design.rst
Expand Up @@ -59,32 +59,16 @@ WSGI application, this is not a recommended configuration.
AsyncIO Workers
---------------

These workers are compatible with python3. You have two kind of workers.
These workers are compatible with Python 3.

The worker `gthread` is a threaded worker. It accepts connections in the
main loop, accepted connections are added to the thread pool as a
connection job. On keepalive connections are put back in the loop
waiting for an event. If no event happen after the keep alive timeout,
the connection is closed.

The worker `gaiohttp` is a full asyncio worker using aiohttp_.

.. note::
The ``gaiohttp`` worker requires the aiohttp_ module to be installed.
aiohttp_ has removed its native WSGI application support in version 2.
If you want to continue to use the ``gaiohttp`` worker with your WSGI
application (e.g. an application that uses Flask or Django), there are
three options available:

#. Install aiohttp_ version 1.3.5 instead of version 2::

$ pip install aiohttp==1.3.5

#. Use aiohttp_wsgi_ to wrap your WSGI application. You can take a look
at the `example`_ in the Gunicorn repository.
#. Port your application to use aiohttp_'s ``web.Application`` API.
#. Use the ``aiohttp.worker.GunicornWebWorker`` worker instead of the
deprecated ``gaiohttp`` worker.
You can port also your application to use aiohttp_'s `web.Application`` API and use the
``aiohttp.worker.GunicornWebWorker`` worker.

Choosing a Worker Type
======================
Expand Down Expand Up @@ -150,13 +134,12 @@ the worker processes (unlike when using the preload setting, which loads the
code in the master process).

.. note::
Under Python 2.x, you need to install the 'futures' package to use this
Under Python 2.x, you need to install the 'futures' package to use this
feature.

.. _Greenlets: https://github.com/python-greenlet/greenlet
.. _Eventlet: http://eventlet.net/
.. _Gevent: http://www.gevent.org/
.. _Hey: https://github.com/rakyll/hey
.. _aiohttp: https://aiohttp.readthedocs.io/en/stable/
.. _aiohttp_wsgi: https://aiohttp-wsgi.readthedocs.io/en/stable/index.html
.. _aiohttp: https://docs.aiohttp.org/en/stable/deployment.html#nginx-gunicorn
.. _`example`: https://github.com/benoitc/gunicorn/blob/master/examples/frameworks/flaskapp_aiohttp_wsgi.py
2 changes: 1 addition & 1 deletion docs/source/run.rst
Expand Up @@ -61,7 +61,7 @@ Commonly Used Arguments
to run. You'll definitely want to read the production page for the
implications of this parameter. You can set this to ``$(NAME)``
where ``$(NAME)`` is one of ``sync``, ``eventlet``, ``gevent``,
``tornado``, ``gthread``, ``gaiohttp`` (deprecated).
``tornado``, ``gthread``.
``sync`` is the default. See the :ref:`worker-class` documentation for more
information.
* ``-n APP_NAME, --name=APP_NAME`` - If setproctitle_ is installed you can
Expand Down
14 changes: 4 additions & 10 deletions gunicorn/config.py
Expand Up @@ -630,25 +630,19 @@ class WorkerClass(Setting):
A string referring to one of the following bundled classes:
* ``sync``
* ``eventlet`` - Requires eventlet >= 0.9.7 (or install it via
* ``eventlet`` - Requires eventlet >= 0.9.7 (or install it via
``pip install gunicorn[eventlet]``)
* ``gevent`` - Requires gevent >= 0.13 (or install it via
* ``gevent`` - Requires gevent >= 0.13 (or install it via
``pip install gunicorn[gevent]``)
* ``tornado`` - Requires tornado >= 0.2 (or install it via
* ``tornado`` - Requires tornado >= 0.2 (or install it via
``pip install gunicorn[tornado]``)
* ``gthread`` - Python 2 requires the futures package to be installed
(or install it via ``pip install gunicorn[gthread]``)
* ``gaiohttp`` - Deprecated.
Optionally, you can provide your own worker by giving Gunicorn a
Python path to a subclass of ``gunicorn.workers.base.Worker``.
This alternative syntax will load the gevent class:
``gunicorn.workers.ggevent.GeventWorker``.
.. deprecated:: 19.8
The ``gaiohttp`` worker is deprecated. Please use
``aiohttp.worker.GunicornWebWorker`` instead. See
:ref:`asyncio-workers` for more information on how to use it.
"""

class WorkerThreads(Setting):
Expand All @@ -671,7 +665,7 @@ class WorkerThreads(Setting):
If it is not defined, the default is ``1``.
This setting only affects the Gthread worker type.
.. note::
If you try to use the ``sync`` worker type and set the ``threads``
setting to more than 1, the ``gthread`` worker type will be used
Expand Down
1 change: 0 additions & 1 deletion gunicorn/workers/__init__.py
Expand Up @@ -7,7 +7,6 @@
SUPPORTED_WORKERS = {
"sync": "gunicorn.workers.sync.SyncWorker",
"eventlet": "gunicorn.workers.geventlet.EventletWorker",
"gaiohttp": "gunicorn.workers.gaiohttp.AiohttpWorker",
"gevent": "gunicorn.workers.ggevent.GeventWorker",
"gevent_wsgi": "gunicorn.workers.ggevent.GeventPyWSGIWorker",
"gevent_pywsgi": "gunicorn.workers.ggevent.GeventPyWSGIWorker",
Expand Down
168 changes: 0 additions & 168 deletions gunicorn/workers/_gaiohttp.py

This file was deleted.

22 changes: 0 additions & 22 deletions gunicorn/workers/gaiohttp.py

This file was deleted.

0 comments on commit 97a4580

Please sign in to comment.