TypeError: ожидалось наличие coroutine, получено None
class Test():
def send(self,dela,i):
time.sleep(dela)
print("process",i)
return
async def proc(self,dela):
task=list()
for i in range(5):
task.append(asyncio.create_task(self.send(3,i)))
res = await asyncio.gather(*task)
print(res)
return
def call(self):
asyncio.run(self.proc(3))
return "123"
obj=Test()
obj.call()
Я хочу выполнять метод send в цикле for параллельно и не хочу ждать завершения каждой итерации, а в конце собирать задачи.