Open funny-falcon opened 7 years ago
Why? Shouldn't the callback "compose" the stuff?
No, cause many libraries works only with default callback, and they will ovewrite "composing" callback.
Can you give an example on what you would like to be able to do?
For example, i would like to store a future in a table by a key, and have many consumers to be informed when future will be completed. And I want it to be transparently supported with all standard library.
In simple words, I want Javascript Promise or Dart's Future or C# Task:
They all may have multiple consumers of result. It is really useful feature, and it will be quite painful to implement outside of standard library
What you want is the Future
to have an error callback. Then you should say so in the title.
No, I didn't mean error callback. Error callback is not as important as multiple callbacks. Error could be signaled with special result value. Mutiple callbacks are much more useful/important.
Promise#then and Future#then could be called several times, and all passed callbacks will be executed.
Any way, I'm not Nim's user (and Future's single callback is one of reasons), so you may close the issue.
But I bet, it will be raised again by other users.
Any way, I'm not Nim's user (and Future's single callback is one of reasons), so you may close the issue.
Don't worry, that's not how things work here. :-)
I'll have to think about this more but my initial thoughts is that this is a good idea.
This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions.
It is quite strange that Future may have only one callback. It limits its composability.