Skip to content

Commit

Permalink
Support Config(loop='none')
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie committed Oct 22, 2019
1 parent a1ea9d9 commit 78ef087
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion uvicorn/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"off": "uvicorn.lifespan.off:LifespanOff",
}
LOOP_SETUPS = {
"none": None,
"auto": "uvicorn.loops.auto:auto_loop_setup",
"asyncio": "uvicorn.loops.asyncio:asyncio_setup",
"uvloop": "uvicorn.loops.uvloop:uvloop_setup",
Expand Down Expand Up @@ -216,7 +217,8 @@ def load(self):

def setup_event_loop(self):
loop_setup = import_from_string(LOOP_SETUPS[self.loop])
loop_setup()
if loop_setup is not None:
loop_setup()

def bind_socket(self):
sock = socket.socket()
Expand Down

0 comments on commit 78ef087

Please sign in to comment.