Skip to content

Commit

Permalink
Merge pull request #455 from encode/support-none-loop
Browse files Browse the repository at this point in the history
Support Config(loop='none')
  • Loading branch information
tomchristie authored Oct 22, 2019
2 parents a1ea9d9 + 78ef087 commit c0806a3
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 c0806a3

Please sign in to comment.