Noticed a few possible improvements to the Future class, in case anybody wants to do them before I get to them, here’s the list:
There appers to be some mutation of @state that doesn’t appear to be guarded in a MT friendly way. :|
I almost wish crystal could somehow introduce some threading concepts so that “carefully guarding stuff” were no longer necessary, but following the old Ruby way of threading is a valid model as well.
For delayed Futures, the docs aren’t clear as to what happens if it’s cancelled “while performing its compute task.” What will get return? Will it still run?
And a feature request: new method
#get_without_raising_unrescued_exceptions (maybe “#join”?), sometimes I just want to wait for a Future, not carefully know (and accomodate for) if it succeeded vs. not. It would return nil I guess.
Just noting ideas here :)