Skip to content

Commit

Permalink
update coroutine docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hhxsv5 committed Jun 26, 2019
1 parent 265e844 commit 845957a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ To make our main server support more protocols not just Http and WebSocket, we b
> [Swoole Coroutine](https://www.swoole.co.uk/coroutine)
- Warning: The order of code execution in the coroutine is out of order. The data of the request level should be isolated by the coroutine ID. However, there are many singleton and static attributes in Laravel/Lumen, the data between different requests will affect each other, it's `Unsafe`. For example, the database connection is a singleton, the same database connection shares the same PDO resource. This is fine in the synchronous blocking mode, but it is not possible in the asynchronous coroutine. Each query needs to create different connections and maintain IO state of different connections, which requires a connection pool. So `DO NOT` enable the coroutine, only the custom process can use the coroutine.
- Warning: The order of code execution in the coroutine is out of order. The data of the request level should be isolated by the coroutine ID. However, there are many singleton and static attributes in Laravel/Lumen, the data between different requests will affect each other, it's `Unsafe`. For example, the database connection is a singleton, the same database connection shares the same PDO resource. This is fine in the synchronous blocking mode, but it does not work in the asynchronous coroutine mode. Each query needs to create different connections and maintain IO state of different connections, which requires a connection pool. So `DO NOT` enable the coroutine, only the custom process can use the coroutine.
- Enable Coroutine, default disable.
Expand Down

0 comments on commit 845957a

Please sign in to comment.