Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultSessionEventHandler.doEventHandlerMethodLookup should use multiple threads. #67

Closed
jacarrichan opened this issue Jun 13, 2014 · 2 comments

Comments

@jacarrichan
Copy link

Currently a client session using an instance of the handler, and the handler is a single thread. A client has sent in two events here. When the server is processing the first event, the second event will not be processed. I think DefaultSessionEventHandler.doEventHandlerMethodLookup should use multiple threads.

@menacher
Copy link
Owner

@jacarrichan this is by design an "event loop" that uses a single thread for high efficiency, just like nodejs and even netty event loop. So events within a single session are always done in the order they arrive. This ordered processing of events is the best default for games.

Of course there are cases where long running tasks, say access to database etc need to be handled, for such cases yes it should be multi-threaded, for that you will need to use another implementation(read your own!) of SessionEventHandler, the DefaultSessionHandler will not be useful in that case.

@jacarrichan
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants