I have the following method that generates data for me:
async def fetch_url(self, video_id):
data = await self.s3.generate_presigned_url(...video_id...)
return data
def convert_to_json(self, data):
loop = asyncio.get_event_loop()
tasks = []
urls = [row[0] for row in data]
for url in urls:
tasks.append(fetch_url(url))
loop.run_until_complete(asyncio.gather(*tasks))
loop.close()
How to store result from fetch_url
in some list?