You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was writing to request some way to integrate Loky promises with asyncio logic. I have a current use case with a FastAPI web service composed mainly of async methods but I do have to launch separate processes to handle some requests.
I would love a way to await a Loky future or the future result method.
I can see I can pass a callback to the Future - or as a hacky work around I could create an async sleep loop that polls the done state of the Future - but if there was a more elegant integration that would be fantastic.
I was thinking something like an "aresult" method on the Future to be an awaitable result - but any integration would be fine.
Futures in the generic sense are supposed to be an Awaitable type in asyncio. I don't know if _BaseFuture could be modified to be recognised as an asyncio Awaitable.
The text was updated successfully, but these errors were encountered:
I noticed to be recognised as an asyncio Future an object had to be recognised by the asyncio.isfuture function and that requires some _ asyncio_future_blocking attribute.
I was writing to request some way to integrate Loky promises with asyncio logic. I have a current use case with a FastAPI web service composed mainly of async methods but I do have to launch separate processes to handle some requests.
I would love a way to await a Loky future or the future result method.
I can see I can pass a callback to the Future - or as a hacky work around I could create an async sleep loop that polls the done state of the Future - but if there was a more elegant integration that would be fantastic.
I was thinking something like an "aresult" method on the Future to be an awaitable result - but any integration would be fine.
Futures in the generic sense are supposed to be an Awaitable type in asyncio. I don't know if _BaseFuture could be modified to be recognised as an asyncio Awaitable.
The text was updated successfully, but these errors were encountered: