in build_artifacts/v3/v3.0/v3.0.0/dirs/etc/sagemaker-inference-server/tornado_server/server.py [0:0]
def serve(self):
"""Orchestrate the initialization and server startup behavior.
Call the initalize() method, determine the right Tornado serving behavior (async or sync),
and then start the Tornado server through asyncio
"""
logger.info("Serving inference requests using Tornado...")
self.initialize()
if asyncio.iscoroutinefunction(self._handler):
import async_handler as inference_handler
else:
import sync_handler as inference_handler
try:
asyncio.run(inference_handler.handle(self._handler, self._environment))
except Exception as e:
raise ServerStartException(e)