Jetty handles all of that. According to this post ...
# javalin
t
Jetty handles all of that. According to this post it used the same threadpool as http handlers, but it's not a 1 to 1 mapping: https://stackoverflow.com/questions/29307949/determine-maximum-websockets-jetty-will-open
a
So is launching threads via
thread {...}
in javalin websockets app good or bad?
I have a shared mutable state which worries me slightly
Its a ‘game’ object that players are getting- and it’s ‘time left’ property needs to be decremented by 1 every second
Not sure how to structure this
t
it shouldn't be necessary to launch new threads
just call
send
and let jetty deal with it
there's also
sendFuture
if you need async