feat(ui): Websocket

Added simple websocket. Serverside websocket logic isnt in the usersession
This commit is contained in:
LQ63
2025-11-21 17:11:16 +01:00
committed by Janis
parent 2bc50664e0
commit 09cc96141d
4 changed files with 74 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
package actor
import org.apache.pekko.actor.{Actor, ActorRef}
import org.apache.pekko.http.scaladsl.model.ContentRange.Other
class KnockOutWebSocketActor(
out: ActorRef,
) extends Actor {
def receive: Receive = {
case msg: String =>
out ! s"Received your message: ${msg}"
case other: Other =>
println(s"Received unknown message: $other")
}
def sendJsonToClient(json: String): Unit = {
println("Received event from Controller")
out ! json
}
}