# SwooleDistributed
High performance, high concurrency, PHP asynchronous distributed framework,power by ext-swoole
Development communication QQ-group:569037921
![](https://box.kancloud.cn/8c458cfdc609f0b5c17beb8a0a79bb85_454x454.png)
Simple websocket case
Chat room: https://github.com/tmtbe/SD-todpole
Live Demo: http://114.55.253.83:8081/
The official website:http://sd.youwoxing.net
Development document:http://docs.youwoxing.net
Instructional video:http://v.qq.com/boke/gplay/337c9b150064b5e5bcfe344f11a106c5_m0i000801b66cfv.html
## Install
You can install via composer
Autoload must specify `app` and `test`.
```
{
"require": {
"tmtbe/swooledistributed":">2.0.0"
},
"autoload": {
"psr-4": {
"app\\": "src/app",
"test\\": "src/test"
}
}
}
```
Then execute the following code in the root directory (the vendor higher directory)
```
php vendor/tmtbe/swooledistributed/src/Install.php
```
The server can be executed in the bin at the end of the installation.
## Advantage
1.High performance and high concurrency, asynchronous event driven
2.HttpClient, client, Mysql, Redis connection pooling
3.Timed task system
4.Coroutine Support
5.Using object pooling mode, optimizing memory allocation and GC
6.Many asynchronous clients, such as MQTT, AMQP, etc.
7.Support cluster deployment
8.User process management
9.Support multi port, multi protocol, automatic conversion between protocols
10.Micro service management based on Consul
11.Automatic discovery of cluster nodes based on Consul
12.Support pubish-subscribe mode
## Architecture diagram
### Class inheritance structure
![image](https://raw.githubusercontent.com/tmtbe/SwooleDistributed/v2/screenshots/k1.png)
### Process structure
![image](https://raw.githubusercontent.com/tmtbe/SwooleDistributed/v2/screenshots/k2.png)
### Cluster structure
![image](https://raw.githubusercontent.com/tmtbe/SwooleDistributed/v2/screenshots/k3.png)
## Donation
If you like the project, I hope you donate this project so that the project will get better development,
Thank you.
Alipay:
![image](https://raw.githubusercontent.com/tmtbe/SwooleDistributed/v2/screenshots/pay.png)
- Introduction
- SD 3.X文档连接
- 导言
- 用户案例
- 基于Swoole扩展分布式全栈开发框架
- 选择SD框架助力企业开发
- 捐赠SwooleDistributed项目
- 框架性能报告
- 更新日志
- VIP服务福利
- 安装与配置
- 【推荐】全自动安装部署
- 环境要求
- 使用Composer安装/更新SD框架
- 通过Docker安装
- 代码结构
- 启动命令
- 服务器配置
- 服务器基础配置server.php
- 客户端协议配置client.php
- business.php
- log.php
- 微服务及集群配置consul.php
- fileHeader.php
- mysql.php
- redis.php
- 定时任务配置timerTask.php
- 服务器端口配置ports.php
- catCache.php
- 验证服务启动成功
- 微服务-Consul
- 日志工具-GrayLog
- 集群-Cluster
- 内核优化
- 入门教学
- 开发流程
- 开发前必读
- 开发规范
- 基本流程
- 框架入口
- Model数据模型
- Controller控制器
- 协程
- 协程基础
- 迭代器
- 调度器
- 使用协程的优势
- 通过协程的方法屏蔽异步同步的区别
- Select多路选择器
- 协程Sleep
- 通用协程方法
- 设置超时
- 设置无异常
- 设置降级函数
- initAsynPools
- dump
- 封装器与路由器
- 封装器
- sendToUid
- 路由器
- sendToUids
- 对象池
- 扩展组件
- 中间件
- Redis使用介绍
- RedisAsynPool
- Redis具体使用
- sendToAll
- RedisRoute
- Redis+Lua
- Mysql使用介绍
- MysqlAsynPool
- Mysql返回值
- 如何获取构建的mysql语句
- 如何执行一个SQL
- 如何执行事务
- stopTask
- Mysql具体使用
- 异步客户端
- Loader
- MqttClient
- model
- SdTcpRpcPool
- task
- HttpClientPool
- view
- TcpClientPool
- AMQP
- initialization
- Memory
- destory
- Cache
- Lock
- Pool
- EventDispatcher
- Process
- Cluster
- TimerTask
- Reload
- Consul
- Context
- 自定义进程
- 进程间RPC
- $http_input
- CatCache
- $http_output
- TimerCallBack
- 专题
- HTTP专栏
- TCP专栏
- 基础知识
- WebSocket专栏
- 微服务
- Consul配置
- RPC
- REST
- AMQP异步任务系统
- MQTT简易服务器
- Docker化以及资源编排
- 快速搭建公司内部统一的开发环境
- 使用HTTPS/WSS
- 订阅/发布
- 游戏专题
- 类介绍
- AppServer
- clearState
- onOpenServiceInitialization
- SwooleDistributedServer
- get_instance
- kickUid
- bindUid
- unBindUid
- coroutineUidIsOnline
- coroutineCountOnline
- setTemplateEngine
- isWebSocket
- isTaskWorker
- getSocketName
- initAsynPools
- addAsynPool
- getAsynPool
- getServerAllTaskMessage
- Controller
- onExceptionHandle
- send
- sendToUid
- sendToUids
- sendToAll
- sendToGroup
- close
- getContext
- defaultMethod
- $redis_pool
- $mysql_pool
- $request_type
- $fd
- $uid
- $client_data
- $request
- $response
- $loader
- $logger
- $server
- $config
- Model
- initialization
- destory
- View
- Task
- stopTask
- HttpInput
- postGet
- post
- get
- getPost
- getAllPostGet
- getAllHeader
- getRawContent
- cookie
- getRequestHeader
- server信息
- getRequestMethod
- getRequestUri
- getPathInfo
- HttpOutput
- setStatusHeader
- setContentType
- setHeader
- end
- setCookie
- endFile
- 单元测试