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

One LuaState for one User? #105

Open
linkerlin opened this issue Jun 30, 2022 · 2 comments
Open

One LuaState for one User? #105

linkerlin opened this issue Jun 30, 2022 · 2 comments
Labels
feature request Enhancement or feature request performance Feature requests related to performance

Comments

@linkerlin
Copy link

LuaState is very expensive for creating.
And if we treat user as a game player and a webpage as a NPC, we can offer only one lua-state for one logined user.
So we can use a coroutine for one user:webpage pair, the context of talking is auto-saved in the coroutine's context.
Every lua-state can save to a key-value store, when it timeouted.
What about it ?

@linkerlin
Copy link
Author

linkerlin commented Jun 30, 2022

By the way, we can use the concurrent-map for managing lua-states.

@xyproto
Copy link
Owner

xyproto commented Jul 2, 2022

This is a good idea! Thanks for reporting.

@xyproto xyproto added feature request Enhancement or feature request performance Feature requests related to performance labels Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Enhancement or feature request performance Feature requests related to performance
Projects
None yet
Development

No branches or pull requests

2 participants