A Future represents a computation that can be executed asynchronously. Any object that implements
Trait named: #TAsyncFuture
package: 'Futures-Base - Futures'
trait can be used as a future. It is important to mention that futures are not executed at the moment of their creation, instead they should be explicitly run by the future executor.
The beauty of futures is that they can be combined to create complex futures. Here is a list of all available future types that can be combined in many ways:
Object variableSubclass: #BlockClosure
instanceVariableNames: 'outerContext startpc numArgs'
can be made into a Future by sending
^ AsyncPollFuture pollBlock: self
simpleFuture <gtExample> ^ [ 21 * 2 ] asAsyncFuture
The return value can be then transformed or mapped as follows:
mapFuture <gtExample> | future | future := self simpleFuture asAsyncFuture. future := future map: [ :x | x * 2 ]. ^ future