]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Add backend param to ASGIDispatcher (#270)
authorFlorimond Manca <florimond.manca@gmail.com>
Fri, 23 Aug 2019 00:26:09 +0000 (02:26 +0200)
committerSeth Michael Larson <sethmichaellarson@gmail.com>
Fri, 23 Aug 2019 00:26:09 +0000 (19:26 -0500)
httpx/dispatch/asgi.py

index 4e3f3dcd8c6bf086e37182657b2befcc94a01a7e..6c1fc267da636da64a77b016b162f944be29eced 100644 (file)
@@ -48,13 +48,13 @@ class ASGIDispatch(AsyncDispatcher):
         raise_app_exceptions: bool = True,
         root_path: str = "",
         client: typing.Tuple[str, int] = ("127.0.0.1", 123),
+        backend: ConcurrencyBackend = None,
     ) -> None:
         self.app = app
         self.raise_app_exceptions = raise_app_exceptions
         self.root_path = root_path
         self.client = client
-        # This will need to be turned into a parameter on this class at some point.
-        self.backend: ConcurrencyBackend = AsyncioBackend()
+        self.backend = AsyncioBackend() if backend is None else backend
 
     async def send(
         self,