zmkeil / nrpc Goto Github PK
View Code? Open in Web Editor NEWA implement of protobuf-rpc based on nginx
A implement of protobuf-rpc based on nginx
This is a protobuf-rpc implement base on nginx. Using nginx core/event modules as network framework, and provides simple programming interfaces. Why Nginx: Nginx implements a set of excellent event and network interface. RPC framework written with these interface can be used well in the Internet environment, for example, it can be used as the network layer of mobile app How to use Nginx: In order to guarantee minimum changes to the nginx, the RPC framework acts as a nginx module which will be dynamically added into the nginx module list at initialization time. The listen port, protobuf service information which users fill through the programming interface are just the same as configuration parameters of this nginx module. Finally call the main function of nginx(renamed as ngx_start) to start the service. And also users can configure the nginx core/event modules with conf/nginx.conf, just the same as Nginx itself. Features: basic RPC functions, such as: 1. port configuration 2. service add/del 3. timeout configuration 4. local_session_context, etc. some additional features. In server side: 1. inherited all attributes of nginx core/event module; 2. connection keepalive and reuse 3. QPS current limit In client side: (implement based on pthread) 1. provide sync/async mode 2. automatic retry mechanism 3. connection pool and reuse How to start: first of all, build the libngx.a with follow command. And before that, please read nginx/README cd nginx && ./ngxlib_install.sh your/path/of/nginx && cd .. then build the libngxplus.a and libnrpc.a cd ngxplus && make && cd .. cd src && make && cd .. now we can programme our app, build with "-lngx -lngxplus -lnrpc", refer to sample/ Additional, some string,network,pthread util function are used, my code tree as follow: code-manager: |-common | |-*.cpp | `-test |-nrpc | |-nginx | |-ngxplus | |-src | |-test | `-sample |-thirdsrc |-gflag `-gtest the common module, you can implement youself, or refer to https://github.com/zmkeil/common.git An associated implement of JAVA client, refer to https://github.com/zmkeil/jrpc-client For details, refer to blog http://www.cnblogs.com/zmkeil/p/5176758.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.