Git Product home page Git Product logo

gos's Introduction

####介绍 [Code For Fun] Gos是一个基于Golang的简易游戏服务器框架

####启动 git checkout https://github.com/mafei198/gos.git go install server && bin/server

######已实现功能

  1. GenServer类似于Erlang的Behavior,封装了Goroutine的基本启动、查找、call、cast,以及对其callback module方法的动态调用
  2. Routes 根据请求协议号,动态的将请求分发到对应的玩家Goroutine处理
  3. Connection 建立TCP连接后自动分配Player Goroutine

####试玩总结 Golang 优点:

  1. 运行效率高:单核TCP ECHO Server, 每秒能处理7w+ 请求(PS: Erlang 4核 7w+)
  2. 典型的C语言风格,流水式开发,面向过程、面向对象都非常方便,容易理解
  3. 结构体与内置Map的支持使得开发非常方便

Golang 缺点:

  1. 多核Scheduler目前实现的还不是很好,GOMAXPROCS的多核利用性能还不能达到其单核 * 多进程的功效,所以如果要充分发挥其性能需要配合多进程的使用,但是进程间的rpc调用将会是一个性能瓶颈
  2. 强类型,静态语言,在写框架的时候比较麻烦
  3. 没有内置REPL交互环境,需要自己写交互Inspect运行时的环境
  4. 没有内置监督树支持,goroutine需要自行管理(锁死、crash)

####TODO

  • Player Goroutine Service:

    1. 热数据加载、持久化
    2. 消息订阅
    3. 消息发布
  • Timertask Manager

    1. 增加、删除、修改定时服务
    2. work pool管理
  • Timertask worker

    1. 定时任务执行
  • 数据库接入

gos's People

Contributors

mafei198 avatar

Watchers

 avatar  avatar

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.