Comments (5)
好的,是個可行的方案,我再嘗試,謝謝
from nano.
- 可以把nano application设计成分布式架构
- 目前nano可以直接作为gate服务器
- 其他的后端服务器, 可以使用gate服务器通过grpc/smux调用后端服务器, 在后端服务器实现一个session.NetEntity结构, 对应目前的agent即可
PS: 可以直接使用smux: https://github.com/xtaci/smux
from nano.
謝謝回覆,我試試看你說的解法!
from nano.
感謝你之前的回覆,我完成了grpc的分散式架構,並用nano當作我的gateway server
但我目前又遇到問題,再麻煩了~
請問我有辦法透過nano取得單一的session和所有的session嗎? (因為會有從後端服務要主動發送到gateway,所以必須從handler以外的地方取得session 和 group)
from nano.
一个比较简单直接的办法就是在包含rpc的Component中使用一个sync.Map保存SessionID => Session
但是你需要注意, 需要在Component的AfterInit生命周期函数中注册SessionClose的回调, 当session关闭, 你需要从map中移除, 并通知rpc后端服务器
from nano.
Related Issues (20)
- cluster模式下 调用rpc error好像永远返回nil
- Detect rpc call success HOT 6
- map并发安全问题
- cluster的设计有点乱,无法用于生产环境
- golang client HOT 1
- 请问iOS,Android 客户端可以直接使用pomelo的客户端文档及源码连接使用吗?
- Server间如何不透过session进行rpc?
- cluster模式,s.RPC通讯不能获取到另一个服务的错误 HOT 2
- Kick数据包类型并没有实现封装调用入口吗 HOT 3
- Why need a session to make an rpc call?
- nano should add uid in gRPC request HOT 2
- What is the cluster restart sequence after a code change?
- 如何拓展使用MongoDB?
- 多Gate sessionId 无法保证全局唯一 HOT 1
- C端长链 agent 长期发送包,是否会导致 Decode 里面的Buffer 不会释放,导致内存泄露
- 未来是否会支持KCP协议?
- 服务多开怎么处理group
- rpc没有返回 HOT 3
- 支持libpomelo吗?
- examples 有很强的误导性
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nano.