From 845957abb25cabfb772193ad2cd2b27afc3d0317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E5=BD=AA?= Date: Wed, 26 Jun 2019 16:26:08 +0800 Subject: [PATCH] update coroutine docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c1431f38..d3fc2ef2 100644 --- a/README.md +++ b/README.md @@ -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.