Skip to content

Commit

Permalink
New ensure import
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Nov 12, 2019
1 parent 7357df8 commit db025dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/appier/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async def asgi_entry(cls, scope, receive, send):
return await cls._asgi.app_asgi(scope, receive, send)

def serve_uvicorn(self, host, port, **kwargs):
util.ensure_pip("uvicorn")
import uvicorn
self.server_version = uvicorn.__version__
reload = kwargs.get("reload", False)
Expand All @@ -70,6 +71,7 @@ def serve_uvicorn(self, host, port, **kwargs):
self._server.run()

def serve_hypercorn(self, host, port, ssl = False, key_file = None, cer_file = None, **kwargs):
util.ensure_pip("hypercorn")
import hypercorn.config
import hypercorn.asyncio
self.server_version = hypercorn.__version__
Expand All @@ -82,6 +84,7 @@ def serve_hypercorn(self, host, port, ssl = False, key_file = None, cer_file = N
asyncio.run(server_coro)

def serve_daphne(self, host, port, **kwargs):
util.ensure_pip("daphne")
import daphne.server
import daphne.cli
self.server_version = daphne.__version__
Expand Down

0 comments on commit db025dd

Please sign in to comment.