--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/dfb6d669-4c05-4058-836e-6347f9ac9780%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If you need to scale it to multiple cores, then you start your Verticle with a number of instances > 1, each core will handle one websocket in Round Robin fashion.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/92434237-a480-4151-8e95-e38424b4fd4c%40googlegroups.com.
Hi,
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/92434237-a480-4151-8e95-e38424b4fd4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/90D6BEC2-31AE-4040-B91A-E83C17C97590%40julienviet.com.
I'd recommend to keep the IO-logic (Socket-handling) and your business/game logic in separate verticles to scale them individually.
Hi,
your business logic can be in the verticle (that also start the websocket server)Vert.x manages the loop, all you need is to feed it with events which can be:- websocket frame events- timer event (periodic task)- your events (reacting to other events cited before)do you have an example of a simplistic game in mind we can try to map ?
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/86b69ecd-d103-45ca-87b5-06b71076c0c0%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/49028909-f7b9-43c5-bd33-cc50098e2c18%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/49028909-f7b9-43c5-bd33-cc50098e2c18%40googlegroups.com.
On Nov 11, 2016, at 7:35 PM, Federico Mouse <federi...@gmail.com> wrote:
On Friday, November 11, 2016 at 3:22:43 PM UTC-3, Jochen Mader wrote:I'd recommend to keep the IO-logic (Socket-handling) and your business/game logic in separate verticles to scale them individually.That's the part that I've yet to understand, how to have the game loop in one verticle, the IO in another, and pass data between both.
On Friday, November 11, 2016 at 3:08:12 PM UTC-3, Julien Viet wrote:Hi,your business logic can be in the verticle (that also start the websocket server)Vert.x manages the loop, all you need is to feed it with events which can be:- websocket frame events- timer event (periodic task)- your events (reacting to other events cited before)do you have an example of a simplistic game in mind we can try to map ?The basics of the game is like this:
- Game server constantly receives "moveTargetXY" packets which I store in the Players object
- The game loop is executed X times per second, evaluating the moveTarget property of each Player, and moving the player to that position.
- The game loop also sends the updated Players information to the connected clients.
The game loop is sequential, but some operations it does are done in threads so they can be executed concurrently (for example, making the World info packets and sending them to each player).Until now what I have done is:
- A verticle which starts a WebSocketServer, and also starts a game loop which runs in a separate thread.
This way, the game logic will scale (as I'm using Java threads to execute them), but the IO won't, as the Verticle message handler is always executed in the same thread.How do you think I should solve it? Maybe 2000 ingoing messages per second whose Handler only set a variable won't be a problem for a single thread?Also, the writeBinnaryMessage operation runs in the same thread that the other handlers? Or it's async and multithreaded?I really appreciate your help
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/86b69ecd-d103-45ca-87b5-06b71076c0c0%40googlegroups.com.
in vertx everything is asynchronous, non blocking and single threaded.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/e5b7d688-3144-4cce-b994-b14472bfb03d%40googlegroups.com.
can you post some code and the stack trace ?
On Nov 12, 2016, at 3:43 AM, Federico Mouse <federi...@gmail.com> wrote:
On Saturday, November 12, 2016 at 6:58:34 AM UTC+8, Julien Viet wrote:in vertx everything is asynchronous, non blocking and single threaded.But earlier today a write to a socket failed, and the exception came from a thread with a different name than the thread which handled the incoming messages, could it be possible or I must saw bad?Btw, thanks for your other comment, I'm doing it similar as how you said.--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/e5b7d688-3144-4cce-b994-b14472bfb03d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/FECA4AAE-BEC0-4776-8E0A-476FAC6F27A5%40julienviet.com.