import asyncio
import threading
from aiohttp import ClientSession
async def fetch(url):
async with ClientSession() as session:
async with session.get(url) as response:
response = await response.read()
print(threading.current_thread().name)
loop = asyncio.get_event_loop()
tasks = [asyncio.ensure_future(fetch("http://example.com")) for i in range(5)]
loop.run_until_complete(asyncio.wait(tasks))