如题:能否提供一个AsyncFunction调用服务端计算的例子。
asyncSum.prototype.evaluateAsync = function (context) {
// use setTimeout to simulate server side evaluation
// in read world it maybe an ajax post to server for evaluation
var args = arguments;
setTimeout(function () {
//如何在这里调用服务端代码?????
context.setAsyncResult(result);
}, 2000);
};
|
|