Code Monkey home page Code Monkey logo

server-framework's Introduction

server framework

跨平台底层库 https://github.com/hujianzhe/util, 下载后置于BootServer目录下

简介:本代码只实现节点启动自举与集群节点之间的消息联动,不包含任何业务代码
模块内部由多个线程处理io,另有一个工作线程处理内部消息和收到的网络消息并派遣到你的业务代码逻辑中
各节点通过读取配置文件加载或更新你自定义的各种服务集群的节点信息
支持按照[一致性hash环,hash取余数,依次轮询,随机,权重值]选取目标集群节点

不太常见的一些特性:
1、纯C编写实现,去除C++干扰,跨平台,不依赖任何第三方框架
2、支持异步回调、协程、消息3种RPC调度机制
3、网络通信支持TCP和可靠UDP

TODO:
1、一个好的说明文档,实在没时间写
2、对脚本语言编写业务逻辑提供支持
3、有状态服务节点的扩容与缩容

模块介绍:
1、BootServer:服务节点启动的必备初始化和操作
2、ServiceTemplate:服务节点代码模板,用来写你的业务逻辑
3、SoTestClient,SoTestServer:测试节点,用于测试功能

编译:
windows直接VS编译 linux下使用make debug 或 make release

启动:
编辑好服务节点启动需要的配置文件(具体格式参看附带的配置文件模板),给每个节点一个配置文件和唯一id,日志标识名,IP和端口号
windows直接VS打开,工程配置好启动参数 <配置文件>
linux编译后,sh run.sh <服务进程> <配置文件>

server-framework's People

Contributors

hujianzhe 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.