English 中文(简体)
启动对“游乐”的反应
原标题:Launching Delayed HTTP Response with Play

我有一个蚊帐,使吉大港山区请求一名控制人员发挥作用,但我的控制者必须等待申请,在一段时间后,我不得不对请求作出答复。 我尝试使用警告,但可以说明如何满足这一需要有助于解决这一问题。

预 收

最佳回答

Awaiting is generally not the best idea. What you probably want to do in this instance is create an Akka actor that gets ping d by the Scheduler every so often. When it receives that ping message it would check if the condition you re looking for exists and would notify all the actor-refs that registered interest in that event.

当你通过询问方式向卡纳克行为者发出信息时,发出这一信息的人就是支持未来的一个行为者。 一旦发出信息,这一信息就会实现。

2.0游乐有简单的“turning an Akka Future into aope Promise。 在那里,你与Akaka和“游戏”一道,进行了同步的方案规划。

So in summary, your Actor needs to react to two messages: RegisterListener Ping

登记册 名单是你用询问方式发出的信息,行为者需要保留提及该听众的笔记,以便在满足条件时通知他们。

问题回答

假设你想在“游戏1.2.x”中这样做,你将使用“条形”功能。 例如,收到请求,等待30次,然后回答,你会这样做。

public static void delay30() {
    await("30s");
    renderText("a-response");
}

你可以使用任何方法,使Text只是一个例子。





相关问题
How to create a custom validator in Play Framework 2.0?

Play 1.0 comes with a full featured validation framework base on http://oval.sourceforge.net/. With the release of 2.0, my custom validators do not work anymore. How does one create custom validator ...

How to contribute modules in Play Framework 2.0?

The original Play Framework 1.x had an elegant and simple module management system. Coupled with the Play repository, it was a great way to quickly enhance an application with third party components &...

How to define a tag with Play 2.0?

There isn t much documentation about Play 2.0 template engine. How does one create a tag using Scala template?

热门标签