at:tutorial:appendix
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
at:tutorial:appendix [2008/07/10 15:42] – added tvcutsem | at:tutorial:appendix [2008/07/10 15:53] – added tvcutsem | ||
---|---|---|---|
Line 389: | Line 389: | ||
==== Futures and Multifutures ==== | ==== Futures and Multifutures ==== | ||
+ | |||
+ | === Futures === | ||
+ | |||
+ | The module ''/ | ||
+ | |||
+ | The module exports the type tags '' | ||
+ | * Tagging an asynchronous message with '' | ||
+ | * Tagging a message with '' | ||
+ | * Tagging a message with '' | ||
+ | |||
+ | Messages can be automatically associated with a future by invoking the '' | ||
+ | |||
+ | The futures module also exports the function '' | ||
+ | |||
+ | Futures can also be created and resolved manually: | ||
+ | < | ||
+ | import / | ||
+ | def [fut, res] := makeFuture(); | ||
+ | when: someAsynchronousComputation() becomes: { |value| | ||
+ | res.resolve(value); | ||
+ | } | ||
+ | fut // return the future to a client | ||
+ | </ | ||
+ | |||
+ | Finally, the futures module also provides some auxiliary functions, of which '' | ||
+ | |||
+ | < | ||
+ | when: (group: [ a<-m(), b<-n() ]) becomes: { |values| | ||
+ | def [aResult, bResult] := values; | ||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Multifutures === | ||
+ | |||
+ | The module ''/ | ||
==== Dynamic Variables ==== | ==== Dynamic Variables ==== | ||
Line 397: | Line 433: | ||
==== Traits ==== | ==== Traits ==== | ||
- | |||
- |
at/tutorial/appendix.txt · Last modified: 2021/09/24 10:28 by elisag