doubles
doubles copied to clipboard
Add support for asyncio.Future
In its current state, doubles
's and_return_future
only returns concurrent.futures.Future
or tornado.concurrent.Future
.
def _get_future():
try:
from concurrent.futures import Future
except ImportError:
try:
from tornado.concurrent import Future
except ImportError:
raise ImportError(
'Error Importing Future, Could not find concurrent.futures or tornado.concurrent',
)
return Future()
To make it work with asyncio
, I had to manually patch _get_future
:
from asyncio import Future
from typing import Any
import doubles
def fix_doubles_future() -> None:
def _get_future() -> Future[Any]:
return Future()
doubles.allowance._get_future = _get_future
fix_doubles_future()
There should be a way to configure this globally or on a per-call basis.
Btw, I'd be happy to implement the fix but it seems this repository is not maintained anymore: https://github.com/uber/doubles/issues/145
@charlax hi charlax i just ran into this as well, should we fork this repo?
@charlax @jmaliksi I hope all is well!
I was already thinking of forking this because I ran into some other issues (see #148).
I will get a new fork up and published, any thoughts on the name?
Oh hey friends!
For sure, let's fork! doubles is awesome.
doubles....2
@charlax @jmaliksi dobles has been launched. It is just at feature parity now, I'll work on improving all the async stuff this week.
Oooooh nice thanks Todd!
On Sun, Oct 29, 2023 at 4:40 PM Todd Sifleet @.***> wrote:
@charlax https://github.com/charlax @jmaliksi https://github.com/jmaliksi dobles https://github.com/smartfastlabs/dobles has been launched. It is just at feature parity now, I'll work on improving all the async stuff this week.
— Reply to this email directly, view it on GitHub https://github.com/uber/doubles/issues/146#issuecomment-1784219255, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5NNNWMCB5ZAZM4YPXQALYB25KPAVCNFSM5OEIMLT2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZYGQZDCOJSGU2Q . You are receiving this because you were mentioned.Message ID: @.***>