我從下面的帖子得到了下面的例子:異步的WebSocket在遊戲框架
http://blog.tksfz.org/2012/10/12/websockets-echo-using-play-scala-and-actors-part-i/
import play.api.libs.concurrent.Akka
import play.api.Play.current // needed by Akka.future
def simpleAsyncWebSocket = WebSocket.async[String] {
Akka.future {
val out = Enumerator.imperative[String]()
val in = Iteratee.foreach[String] {
msg =>
out.push(msg)
}
(in, out)
}
}
這裏的問題是執行上下文將上面的代碼中使用?我嘗試在我的Play應用程序中使用它。她是我已經配置爲默認執行上下文:
play {
akka {
event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
loglevel = WARNING
actor {
default-dispatcher = {
fork-join-executor {
parallelism-factor = 3.0
parallelism-max = 256
}
}
}
}
}
我如何將自定義執行上下文附加到上面的示例代碼?
感謝您的信息。讓我明天嘗試一下,並告訴你是否有幫助。 – sparkr