【发布时间】:2012-09-07 15:35:34
【问题描述】:
我正在使用 java 玩 2.0 应用程序。我正在使用 promise 来异步发送电子邮件。为此我关注了http://www.playframework.org/documentation/2.0/JavaAsync
我试过这样:
Promise<Result> promiseOfInt = Akka.future(
new Callable<Result>() {
public Result call() {
try {
sendMail(form,to,sub,msg);
} catch (MessagingException e) {
e.printStackTrace();
}
return null; } } );
然后我得到了这个错误: [警告] [09/07/2012 19:34:40.737] [新 I/O 工作者 #14] [调度程序] 调度程序 [akka.actor.promises-dispatcher] 未配置,使用默认调度程序
我是异步编程的新手。我不知道如何处理承诺。任何人都可以帮助我。请提供示例。感谢Adv.
【问题讨论】:
标签: asynchronous akka future promise play2-mini