Skip to content

Commit 30d7145

Browse files
committed
fixed coroutine not enabled
Signed-off-by: bota <[email protected]>
1 parent 77d0c50 commit 30d7145

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Swoole/ServerFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class ServerFactory
6969
* @throws InvalidArgumentException For invalid $port values.
7070
* @throws InvalidArgumentException For invalid $mode values.
7171
* @throws InvalidArgumentException For invalid $protocol values.
72+
* @throws \ErrorException
7273
*/
7374
public function __invoke(ContainerInterface $container): SwooleServer
7475
{
@@ -106,7 +107,7 @@ public function __invoke(ContainerInterface $container): SwooleServer
106107

107108
$enableCoroutine = $swooleConfig['enable_coroutine'] ?? false;
108109
if ($enableCoroutine) {
109-
SwooleRuntime::enableCoroutine();
110+
SwooleRuntime::enableCoroutine(1);
110111
}
111112

112113
$httpServer = new SwooleServer($host, $port, $mode, $protocol);

0 commit comments

Comments
 (0)