import asyncio from aiohttp import web import time async def process(): for i in range(10): print("process data !!") # time.sleep(1) await asyncio.sleep(1) async def hello(request): job = process() asyncio.create_task(job) return web.Response(text='Hello Aiohttp!') app = web.Application() app.router.add_get("/hello",hello) web.run_app(app, host="0.0.0.0", port=9000)