I have a controller in my project which has a socket method I want to call that method in companion object.But somehow i am not able to do that as i need to pass parameters also to companion object , which i can't . Here's my code sample:
class WebSocketController @Inject() (cache:CacheApi)(implicit actorSystem:ActorSystem, materializer:Materializer) extends Controller {
def socket = WebSocket.accept[JsValue , JsValue] { request =>
ActorFlow.actorRef(out => SocketHandlerClass.props(out,postActor))
}
}
/*My Companion Object */
object WebSocketController {
/* how to call socket method here ???*/
}