A function that returns a Future object, which is an eventual result of an asynchronous operation
runAsync(function() {})
→ returns any
1000
future = runAsync(function(){
return "Hello World!";
});
writeOutput(future.get());
Expected Result: Hello World!
future = runAsync(function(){
return 5;
}).then(function(input){
return input + 2;
});
result = future.get(3); // 3 is timeout(in ms)
writeOutput(result);
Expected Result: 5
future = runAsync(function(){
return 5;
}).then(function(input){
return input + 2;
}).error(function(){
return "Error occurred.";
});
writeOutput(future.get());
Expected Result: 7
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.