async with aiohttp.ClientSession() as session:
async with session.get(url) as resp:
response = await resp.json()
class MyConsumer(WebsocketConsumer):
stop = false
def connect(self):
...
for counter, url in enumerate(urls, 1):
if self.stop:
break;
...
def disconnect(self, code):
self.stop = true