Skip to content

Instantly share code, notes, and snippets.

Avatar

TryCF.com trycf

View GitHub Profile
@trycf
trycf / acf2018-beta-futures.cfm
Created Apr 17, 2018
Adobe ColdFusion 2018 Beta - Futures
View acf2018-beta-futures.cfm
<cfscript>
getAccountBalance = function(){
var balance = 120000;
return balance;
}
function payCreditCardBill(accountBalance){
var ccBill = 1890;
return accountBalance-ccBill;
}
View emptyfuture.cfm
<cfscript>
p = runAsync(); // empty future
p.complete(function(){
sleep(1000)
return "done!"
});
a = p.get();
writeOutput(a()); // displays done!
</cfscript>
View trycf-gist-1524078090949-a0d583c4-ed94-496c-5f69-c4b9616e880f.cfm
<cfscript>
a = function () {
writeoutput("a was called!<hr />");
return "a";
}
writeoutput("before runAsync<hr />");
future = runAsync(a);