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

如何在多个服务器之间共享变量? #1028

Open
halsn opened this Issue May 8, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@halsn

halsn commented May 8, 2018

例如我有两台chat-server,前端用户连过来后会随机分配一个chat-server进行处理,但是不同的chat-server处理逻辑需要用到同一个变量,请问pomelo有没有对应的API可以设置全局共享变量?

@whtiehack

This comment has been minimized.

whtiehack commented May 9, 2018

可以加到 session上。或者用redis

@yangfch3

This comment has been minimized.

yangfch3 commented May 18, 2018

进程间共享数据的话用 redis 或者 mc 做中介,但要注意数据一致性(锁)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment