@viktorklang: The primary reason why #Scala Futures are not Cancellable is because that makes them not freely sharable. Promises are cancellable. Alice: creates Promise `p` with intent to produce a value. Bob: obtains a reference to `p` from Alice, Bob is now able to complete it Alice: can during the production of the value of `p` interrogate whether `p` has already been completed, and cancel the production of the value. Thus, Promise is a “permission to write a value" and Future is a "permission to read a value”.
Tag Archives: promise
@viktorklang: The primary reason why #Scala Futures are not Cancellable is because that makes them not freely sharable. Promises are cancellable. Alice: creates Promise `p` with intent to produce a value. Bob: obtains a reference to `p` from Alice, Bob is now able to complete it Alice: can during the production of the value of `p` interrogate whether `p` has already been completed, and cancel the production of the value. Thus, Promise is a “permission to write a value" and Future is a "permission to read a value”.