All Projects → elarity → Ti Rpc

elarity / Ti Rpc

Licence: mit
基于swoole封装的一个简易的JSON协议的RPC框架,思路是借鉴的,代码是自己写的。小修小改的,目前服务于前公司(注意是前公司)生产环境,每日支撑大约8000万次调用。

Projects that are alternatives of or similar to Ti Rpc

Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (+269.44%)
Mutual labels:  rpc, json, tcp
Swoft Im
基于swoft-cloud的微服务架构,最小化拆分粒度,PHP7、多进程、协程、异步任务、mysql连接池、redi连接池、rpc连接池、服务治理、服务注册与发现、Aop切面、全注解
Stars: ✭ 189 (+31.25%)
Mutual labels:  rpc, swoole, tcp
Dora Rpc
DoraRPC is an RPC For the PHP MicroService by The Swoole
Stars: ✭ 475 (+229.86%)
Mutual labels:  rpc, swoole, tcp
Co
Art of C++. Flag, logging, unit-test, json, go-style coroutine and more.
Stars: ✭ 2,264 (+1472.22%)
Mutual labels:  rpc, json, tcp
Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (-8.33%)
Mutual labels:  rpc, json, tcp
Scalecube Services
v2.0 - ScaleCube Services provides a low latency Reactive Microservices library for serverless service registry and discovery based on gossip protocol and without single point-of-failure or bottlenecks.
Stars: ✭ 23 (-84.03%)
Mutual labels:  rpc, tcp
Goridge
High-performance PHP-to-Golang IPC bridge
Stars: ✭ 950 (+559.72%)
Mutual labels:  rpc, tcp
Wheel
关于net nio os cache db rpc json web http udp tcp mq 等多个小工具的自定义实现
Stars: ✭ 45 (-68.75%)
Mutual labels:  rpc, json
Autocser
AutoCSer is a high-performance RPC framework. AutoCSer 是一个以高效率为目标向导的整体开发框架。主要包括 TCP 接口服务框架、TCP 函数服务框架、远程表达式链组件、前后端一体 WEB 视图框架、ORM 内存索引缓存框架、日志流内存数据库缓存组件、消息队列组件、二进制 / JSON / XML 数据序列化 等一系列无缝集成的高性能组件。
Stars: ✭ 140 (-2.78%)
Mutual labels:  rpc, json
Swoft Framework
[READ ONLY] Swoft Framework, base of Swoft
Stars: ✭ 70 (-51.39%)
Mutual labels:  rpc, swoole
Pool
General Purpose Connection Pool for GRPC,RPC,TCP Sevice Cluster
Stars: ✭ 98 (-31.94%)
Mutual labels:  rpc, tcp
Libjson Rpc Cpp
C++ framework for json-rpc (json remote procedure call)
Stars: ✭ 653 (+353.47%)
Mutual labels:  rpc, json
Swoft
🚀 PHP Microservice Full Coroutine Framework
Stars: ✭ 5,420 (+3663.89%)
Mutual labels:  rpc, swoole
Spyne
A transport agnostic sync/async RPC library that focuses on exposing services with a well-defined API using popular protocols.
Stars: ✭ 992 (+588.89%)
Mutual labels:  rpc, json
Grain
grain是一个极简的、组件式的RPC框架,灵活且适合渐进学习,可与任何框架整合。同时包含(系统通用多线程模型与消息通讯 || 多对多关系的分布式锁 || 基于Servlet的HTTP框架 || 基于系统通用多线程模型的Websocket框架 || 支持行级锁的多线程锁 )等组件,按需选择组件,不绑架开发者。
Stars: ✭ 577 (+300.69%)
Mutual labels:  rpc, tcp
Netty Stroll
RPC基础通信框架
Stars: ✭ 77 (-46.53%)
Mutual labels:  rpc, tcp
Deta cache
缓存cache服务器
Stars: ✭ 106 (-26.39%)
Mutual labels:  json, tcp
Simpletcp
Simple wrapper for TCP client and server in C# with SSL support
Stars: ✭ 99 (-31.25%)
Mutual labels:  rpc, tcp
Jsonrpc
The jsonrpc package helps implement of JSON-RPC 2.0
Stars: ✭ 143 (-0.69%)
Mutual labels:  rpc, json
Swoole study
一份Swoole入门教程,根据作者的个人理解编写,常见的Swoole入门知识和讲解。
Stars: ✭ 509 (+253.47%)
Mutual labels:  swoole, tcp

Ti RPC

swoole版本说明

这个东西做出来的时候时间比较早,当时swoole 2.0也才刚发版没多久。所以,这个玩意在swoole 1.x系列和swoole 2.x系列里是没什么问题的。但是swoole 4可能发生的一些变动可能会导致这个玩意报一些错。我建议是:swoole 4情况下,不优先考虑这个;如果一定要考虑,自己修一下吧。因为swoole后面是重协程的,而咱这个玩意主要思路还是多进程方式。至于会不会改进做一个协程版本的:会做。但是没有经历至少几十万用户验证前,我应该不会轻易扔出来的。现有的这个版本虽然在协程时代显得LOW,但是贵在经历过百万级的用户体量考验。

简要概述:

封装的比较简单,代码风格略粗暴,没有过多的组件以及厚重的包装,我不太喜欢过于复杂的东西。整体思路是借鉴蓝天的,代码则自己实现(你也可以认为是抄袭),自己做了些许改动。由于第一个版本我实现的比较烂,所以没有放出来,这个版本代码略干净能看一些,又在我们公司生产环境经过长期的验证,每日支撑将近8000万次的调用,所以我就放出来了。

我不会刻意去推广这个,也会长期改进维护,只希望能帮到一些人。

TODO LIST:

1.加入更好的异常机制代替丑陋的if else

2.加入包头定长拆包协议(已实现)

VIM配置

set shiftwidth=2

set softtabstop=2

set tabstop=2

set rnu

set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1

set enc=utf8

set fencs=utf8,gbk,gb2312,gb18030

功能简介:

1.同时提供tcp和http两种方式。

2.提供四种不同调用方式:

SW : 单个请求,等待结果

SN : 单个请求,不等待结果

MW : 多个请求,等待结果

MN : 多个请求,不等待结果

3.客户端可以通过长链接连接RPC服务,避免TCP握挥手带来的性能损耗

4.TCP提供根据数据长度拆包和包头定长两种拆包方式,默认启用包头定长

5.其余特性参考 http://wiki.swoole.com

部署安装

  1. git clone https://github.com/elarity/ti-rpc.git
  2. 到ti-rpc根目录下执行php index.php查看使用方式

已经加入对composer的支持,根目录下有个composer.json,请不要随意修改其中内容如果你明白你在做什么操作。如果你需要从github找到一个php库并使用,比如这个curl类,那么你需要在ti rpc的根目录下执行如下命令:

composer require php-curl-class/php-curl-class

这个时候,ti rpc将会采用composer自动加载器而不是自定义的自动加载,从而可以方便粗暴快捷简单地使用任何一个php composer库

使用方式

php index.php [command] [option]
  • start,以非daemon形式开始服务,也就是debug模式
  • start -d,以daemon模式开启服务,一般用于正式部署
  • stop,停止服务
  • reload,热加载业务代码
  • status,查看服务状态

内容添加

  1. 添加curl和RNCryptor加解密库

联系方式:

wechat:sbyuanmaomao

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].