GithubHelp home page GithubHelp logo

Comments (5)

kenchiang1211 avatar kenchiang1211 commented on July 19, 2024 3

好的,是個可行的方案,我再嘗試,謝謝

from nano.

lonng avatar lonng commented on July 19, 2024
  1. 可以把nano application设计成分布式架构
  2. 目前nano可以直接作为gate服务器
  3. 其他的后端服务器, 可以使用gate服务器通过grpc/smux调用后端服务器, 在后端服务器实现一个session.NetEntity结构, 对应目前的agent即可

PS: 可以直接使用smux: https://github.com/xtaci/smux

from nano.

kenchiang1211 avatar kenchiang1211 commented on July 19, 2024

謝謝回覆,我試試看你說的解法!

from nano.

kenchiang1211 avatar kenchiang1211 commented on July 19, 2024

感謝你之前的回覆,我完成了grpc的分散式架構,並用nano當作我的gateway server
但我目前又遇到問題,再麻煩了~

請問我有辦法透過nano取得單一的session和所有的session嗎? (因為會有從後端服務要主動發送到gateway,所以必須從handler以外的地方取得session 和 group)

from nano.

lonng avatar lonng commented on July 19, 2024

一个比较简单直接的办法就是在包含rpc的Component中使用一个sync.Map保存SessionID => Session
但是你需要注意, 需要在Component的AfterInit生命周期函数中注册SessionClose的回调, 当session关闭, 你需要从map中移除, 并通知rpc后端服务器

from nano.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.