Skip to content

Commit

Permalink
append filename to title
Browse files Browse the repository at this point in the history
  • Loading branch information
farwish committed Aug 30, 2019
1 parent 3729d39 commit 84ddae3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions 3.Swoole编程须知/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Swoole 编程须知

## 睡眠函数的影响
## 睡眠函数的影响 [sleep.php]

1.睡眠函数会使工作进程陷入阻塞,直到指定时间后操作系统才会唤醒进程。

Expand All @@ -15,7 +15,7 @@
3.开启协程定时器调度
```

## 中止函数的影响
## 中止函数的影响 [exit.php]

1.中止函数 (exit, die) 会使工作进程立即退出,异常退出会被 master 重新拉起,从而导致工作进程不断退出和拉起。

Expand All @@ -36,7 +36,7 @@
2.当前工作进程依然可以处理其它任务。
```

## 死循环的影响
## 死循环的影响 [while.php]

1.死循环取得控制权后,IO 事件回调函数无法触发,无法再收到客户端请求。

Expand All @@ -49,7 +49,7 @@
2.增加工作进程提高处理能力。
```

## 随机函数的影响
## 随机函数的影响 [rand.php]

主进程使用过随机数发生器,子进程内 rand 返回的结果是相同的,使用随机数发生器的函数有 rand, srand, shuffle, array_rand。

Expand All @@ -60,7 +60,7 @@
2.在子进程内使用 srand 重新播种。
```

## 进程隔离
## 进程隔离 [isolation.php]

进程隔离是为保护操作系统中进程互不干扰而设计的一组不同硬件和软件的技术。进程彼此的内存空间是独立的。

Expand Down
16 changes: 8 additions & 8 deletions 4.Swoole服务器/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Swoole 服务器

## TCP 服务器
## TCP 服务器 [tcp.php]

什么是 TCP ?
```
Expand Down Expand Up @@ -36,7 +36,7 @@ $socket_type Socket 的类型($socket_type | SWOOLE_SSL 启用 SSL 加密,

更多信息@doc https://wiki.swoole.com/wiki/page/14.html

## UDP 服务器
## UDP 服务器 [udp.php]

什么是 UDP ?
```
Expand Down Expand Up @@ -77,7 +77,7 @@ $ netcat -u ip port

更多信息@doc https://wiki.swoole.com/wiki/page/14.html

## Server 四层生命周期
## Server 四层生命周期 [lifecycle.php]

PHP 完整生命周期
```
Expand Down Expand Up @@ -114,15 +114,15 @@ Swoole Server 四层生命周期
请求期创建的对象会在请求完成后销毁,和 fpm 程序中的对象一样。
```

## 全局配置选项详解
## 全局配置选项详解 [setting.php]

Swoole\Server::set 用于设置 Server 运行时的各项参数,使用数组元素配置。

Swoole 的难点除了系统和网络外,相当一部分原因是由于配置选项繁多,未做拆分,不利于学习。

更多信息@doc https://wiki.swoole.com/wiki/page/274.html

## 事件回调函数详解
## 事件回调函数详解 [callback.php]

Swoole\Server 是事件驱动模式,所有的业务逻辑代码必须写在事件回调函数中。当特定的网络事件发生后,底层会主动回调指定的 PHP 函数。

Expand Down Expand Up @@ -316,7 +316,7 @@ open_websocket_close_frame 启用 WebSocket 协议中关闭帧(opcode 为 0x08)
聊天程序: https://github.com/farwish/PCP/tree/master/Project/Swoole


## Redis 服务器
## Redis 服务器 [redis.php]

Swoole\Redis\Server

Expand Down Expand Up @@ -360,7 +360,7 @@ Server::SET 返回列表(数组)
Server::MAP 返回 Map(关联数组)
```

## 毫秒定时器
## 毫秒定时器 [timer.php]

Swoole\Timer

Expand All @@ -385,7 +385,7 @@ stats 返回统计信息(需要 swoole-4.4 及以上)

@doc https://wiki.swoole.com/wiki/page/p-timer.html

## 执行异步任务
## 执行异步任务 [task.php]

Swoole 异步任务

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Swoole 入门到进阶

本课程帮助大家较为轻松入门 Swoole,掌握 Swoole 几乎所有常见用法,为工作中应用打下坚实基础。
swoole-wholly 帮助大家较为轻松入门 Swoole,掌握 Swoole 几乎所有常见用法,为工作中应用打下坚实基础。

```
Swoole 是面向生产环境的 PHP 异步网络通信引擎,使 PHP 开发人员可以编写高性能的异步并发 TCP、UDP、Unix Socket、HTTP 和 WebSocket 服务。
Expand Down

0 comments on commit 84ddae3

Please sign in to comment.