ヘギークス。プロジェクトでライブ通知モジュールをコーディングしています。関数から WebSocket Action メソッドを呼び出して、接続を介してクライアントに通知データを渡すことを試みています。
これが私のコードです..
def liveNotification(data: String) = WebSocket.using[JsValue] { implicit request =>
val iteratee = Iteratee.ignore[JsValue]
val enumerator = Enumerator[JsValue](Json.toJson(data))
(iteratee,enumerator)
}
def createNotification(notificationTo: BigInteger, notiParams:Tuple5[String,String,BigInteger,BigInteger,BigInteger]) = {
val retData = NotificationModel.createNotification(notificationTo,notiParams)
val strData = write(retData)
liveNotification(strData)
}
問題は、「liveNotification()」呼び出しが単純に無視されることです。私が間違っていることを教えてください。