Skip to content

Commit 8ee2bf4

Browse files
committed
rename HandlerManager to RequestHandlerFactory
1 parent f71b6af commit 8ee2bf4

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

aiohttp/web.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
__all__ = [
2828
'Application',
2929
'HttpVersion',
30-
'HandlerManager',
3130
'RequestHandler',
31+
'RequestHandlerFactory',
3232
'Request',
3333
'StreamResponse',
3434
'Response',
@@ -1200,7 +1200,7 @@ def handle_request(self, message, payload):
12001200
self.log_access(message, None, resp_msg, self._loop.time() - now)
12011201

12021202

1203-
class HandlerManager:
1203+
class RequestHandlerFactory:
12041204

12051205
def __init__(self, app, router, *,
12061206
handler=RequestHandler, loop=None, **kwargs):
@@ -1257,7 +1257,7 @@ def __call__(self):
12571257
class Application(dict):
12581258

12591259
def __init__(self, *, logger=web_logger, loop=None,
1260-
router=None, handler=HandlerManager, **kwargs):
1260+
router=None, handler_factory=RequestHandlerFactory, **kwargs):
12611261
# TODO: explicitly accept *debug* param
12621262
if loop is None:
12631263
loop = asyncio.get_event_loop()
@@ -1266,7 +1266,7 @@ def __init__(self, *, logger=web_logger, loop=None,
12661266
assert isinstance(router, AbstractRouter), router
12671267

12681268
self._router = router
1269-
self._handler = handler
1269+
self._handler_factory = handler_factory
12701270
self._finish_callbacks = []
12711271
self._loop = loop
12721272
self.logger = logger
@@ -1282,7 +1282,8 @@ def loop(self):
12821282
return self._loop
12831283

12841284
def make_handler(self, **kwargs):
1285-
return self._handler(self, self.router, loop=self.loop, **kwargs)
1285+
return self._handler_factory(
1286+
self, self.router, loop=self.loop, **kwargs)
12861287

12871288
@asyncio.coroutine
12881289
def finish(self):

docs/web.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ Application is a synonym for web-server.
663663

664664
To get fully working example, you have to make *application*, register
665665
supported urls in *router* and create a *server socket* with
666-
:class:`aiohttp.HandlerManager` as a *protocol factory*. *HandlerManager*
666+
:class:`aiohttp.RequestHandlerFactory` as a *protocol factory*. *RequestHandlerFactory*
667667
could be constructed with :meth:`make_handler`.
668668

669669
*Application* contains a *router* instance and a list of callbacks that
@@ -719,7 +719,7 @@ arbitrary properties for later access from
719719

720720
Creates HTTP protocol factory for handling requests.
721721

722-
:param kwargs: additional parameters for :class:`HandlerManager`
722+
:param kwargs: additional parameters for :class:`RequestHandlerFactory`
723723
constructor.
724724

725725
You should pass result of the method as *protocol_factory* to
@@ -760,10 +760,10 @@ arbitrary properties for later access from
760760
:meth:`finish` will un-yield (`yield from`) the later.
761761

762762

763-
HandlerManager
764-
^^^^^^^^^^^^^^
763+
RequestHandlerFactory
764+
^^^^^^^^^^^^^^^^^^^^^
765765

766-
HandlerManager is responsible for creating HTTP protocol objects that
766+
RequestHandlerFactory is responsible for creating HTTP protocol objects that
767767
can handle http connections.
768768

769769
.. attribute:: connections

tests/test_web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_logging(self):
9191
self.assertIs(app.logger, logger)
9292

9393

94-
class TestHandlerManager(unittest.TestCase):
94+
class TestRequestHandlerFactory(unittest.TestCase):
9595

9696
def setUp(self):
9797
self.loop = asyncio.new_event_loop()

0 commit comments

Comments
 (0)