Play 2.6 中自定义数据类型的 WebSocket 缺少隐式消息流转换器

WebSocket Missing implicit Message Flow Transformer for custom data type in play 2.6

我正在尝试在客户端和服务器之间建立一个web socket连接,但是数据类型需要一个隐式的MessageFlowTransformer,播放文档只介绍了String和JsValue转换,我有以下数据类型:

sealed trait InEvent
sealed trait outEvent

  final case class AckInEevent(serial: Long) extends InEvent
  final case class AckOutEevent(serial: Long) extends outEvent
//theWebSocket action handler :

def accept = WebSocket.tryAcceptWithActor[InEvent, outEvent] { request => .....}

我收到一条错误指示

could not find implicit value for parameter transformer: play.api.mvc.WebSocket.MessageFlowTransformer[InEvent, outEvent]

尝试

sealed trait InEvent
sealed trait outEvent

final case class AckInEevent(serial: Long) extends InEvent
final case class AckOutEevent(serial: Long) extends outEvent

import play.api.libs.json._
implicit val ackInEeventFormat = Json.format[AckInEevent]
implicit val ackOutEeventFormat = Json.format[AckOutEevent]
implicit val inEeventFormat = Json.format[InEvent]
implicit val outEeventFormat = Json.format[outEvent]

implicit val messageFlowTransformer =
  MessageFlowTransformer.jsonMessageFlowTransformer[InEvent, outEvent]

def accept = WebSocket.tryAcceptWithActor[InEvent, outEvent] { request => ???}

libraryDependencies += "org.julienrf" %% "play-json-derived-codecs" % "6.0.0"

https://github.com/coding-jam/lagioconda/blob/master/frontend/app/protocol/Protocol.scala