Create async(exp) wrapper to load value asynchronously
This is becoming a common pattern:
var results = Collection()script {
async {
results = SomeService.call();
}
}list(r in results) {
…
}It would be nice, if it could be rewritten as follows:
var results = async(SomeService.call());list(r in results) {
…
}With the same result. This would require a dependency analysis (i.e. other variables that depend on this variable would have to be initialized later too, unless they’re derived variables).
Submitted by Zef Hemel on 17 August 2010 at 12:02