-
-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Labels
Milestone
Description
I'm using Jooby's MVC routes for an API. I have also set up a websocket, to which a few clients connect. What I'm trying to do is send a message to all connected websocket clients whenever a specific http request is received in the server. This is how my route method looks like:
@Path("/player")
@Produces("application/json")
public class PlayerRoute {
@POST
public Result newPlayer(Request req, @Body Player player) {
//this is what I'm trying to achieve..
allWebsocketSessions.foreach(session ->
session.send("a new player has been created")
);
return Results.ok();
}
}
I've read jooby's documentation but can't figure out how to do it.
Thanks in advance.