Open callumforrester opened 1 month ago
Is there a usecase for this? Now we have AsyncStatus.wrap
taking arbitrary kwargs then we are mostly getting either a Task or a coroutine, so I propose to ban all other alternatives...
I have no strong preference whether the type signature is changed or things that aren't coroutines are supported, as long as one of those things happens. The only convenient use case I can think of is:
def do_thing() -> AsyncStatus:
return AsyncStatus(asyncio.gather(task_1(), task_2(), task_3()))
I have no strong preference whether the type signature is changed or things that aren't coroutines are supported, as long as one of those things happens. The only convenient use case I can think of is:
def do_thing() -> AsyncStatus: return AsyncStatus(asyncio.gather(task_1(), task_2(), task_3()))
As we can do this:
@AsyncStatus.wrap
async def do_thing():
return await asyncio.gather(task_1(), task_2(), task_3())
I think we should change it to only accept coroutines and Tasks
So this should change the type signature and docs to say that it only takes a Coroutine
or a Task
, not an Awaitable
If a gather is passed, for example: