Is there something like Scala Promise in F #?
While futures are defined as a read-only placeholder type created for a result that does not yet exist, you might think of a writable container with one assignment that completes the future. That is, a promise can be used to successfully complete a future with a value (by "completing" a promise) using the success method. Conversely, a promise can also be used to complete the future, except that it was not possible to fulfill the promise using the reject method.
Async stuff covers some of this, but if you have code that runs outside of Async, Promises is a handy tool. (For example, you can do things like a full promise in a user interface thread, even if the user interface environment knows nothing about Async.)
promise scala f #
James moore
source share