File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
frameworks/Python/aiohttp/app Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 1+ import multiprocessing
12import os
3+ import platform
24import socket
3- import multiprocessing
5+
46from aiohttp import web
7+
58from .main import create_app
6- import uvloop
79
810SERVERS_COUNT = multiprocessing .cpu_count ()
911BACKLOG = 2048
1214def start_server (sock , cpu_id ):
1315 if hasattr (os , "sched_setaffinity" ):
1416 os .sched_setaffinity (0 , {cpu_id })
15- uvloop .install ()
17+ if platform .python_implementation () != "PyPy" :
18+ import uvloop
19+ uvloop .install ()
1620 app = create_app ()
1721
1822 web .run_app (app , sock = sock , backlog = BACKLOG , access_log = None )
@@ -43,4 +47,4 @@ def create_reusable_socket(host='0.0.0.0', port=8080):
4347 workers .append (worker )
4448
4549 for worker in workers :
46- worker .join ()
50+ worker .join ()
You can’t perform that action at this time.
0 commit comments