mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
Enable coroutine.
This commit is contained in:
parent
ddf604bde1
commit
e04b44dcf2
@ -39,12 +39,13 @@
|
||||
"monolog/monolog": "^1.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/common": "@stable",
|
||||
"friendsofphp/php-cs-fixer": "^2.14",
|
||||
"malukenho/docheader": "^0.1.6",
|
||||
"mockery/mockery": "^1.0",
|
||||
"phpunit/phpunit": "^7.0.0",
|
||||
"php-di/php-di": "^6.0",
|
||||
"doctrine/common": "@stable",
|
||||
"friendsofphp/php-cs-fixer": "^2.14"
|
||||
"phpunit/phpunit": "^7.0.0",
|
||||
"swoft/swoole-ide-helper": "^4.3"
|
||||
},
|
||||
"replace": {
|
||||
"hyperf/amqp": "self.version",
|
||||
|
@ -371,6 +371,8 @@ abstract class Command extends SymfonyCommand
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ($this->coroutine) {
|
||||
// Enable Coroutine in co environment.
|
||||
\Swoole\Runtime::enableCoroutine(true);
|
||||
go(function () {
|
||||
call([$this, 'handle']);
|
||||
});
|
||||
|
@ -42,6 +42,8 @@ class StartServer extends SymfonyCommand
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
\Swoole\Runtime::enableCoroutine(true);
|
||||
|
||||
$this->checkEnvironment($output);
|
||||
|
||||
$serverFactory = $this->container->get(ServerFactory::class)
|
||||
|
Loading…
Reference in New Issue
Block a user