Add uvloop argument

pull/21904/head
Lidi Zheng 5 years ago
parent c0e1dbc445
commit bbcaca2d83
  1. 7
      src/python/grpcio_tests/tests_aio/benchmark/worker.py
  2. 2
      src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py

@ -46,6 +46,13 @@ if __name__ == '__main__':
type=int,
dest='port',
help='The port the worker should listen on')
parser.add_argument('--uvloop',
action='store_true',
help='Use uvloop or not')
args = parser.parse_args()
if args.uvloop:
import uvloop
uvloop.install()
asyncio.get_event_loop().run_until_complete(run_worker_server(args.port))

@ -33,7 +33,7 @@ from tests_aio.benchmark import benchmark_client, benchmark_servicer
_NUM_CORES = multiprocessing.cpu_count()
_WORKER_ENTRY_FILE = os.path.join(
os.path.split(os.path.abspath(__file__))[0], '/worker.py')
os.path.split(os.path.abspath(__file__))[0], 'worker.py')
_LOGGER = logging.getLogger(__name__)

Loading…
Cancel
Save