We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6b62b7 commit d6904e9Copy full SHA for d6904e9
1 file changed
src/Command.php
@@ -50,6 +50,13 @@ abstract class Command extends SymfonyCommand
50
*/
51
protected $verbosity = OutputInterface::VERBOSITY_NORMAL;
52
53
+ /**
54
+ * Execution in a coroutine environment.
55
+ *
56
+ * @var bool
57
+ */
58
+ protected $coroutine = false;
59
+
60
/**
61
* The mapping between human readable verbosity levels and Symfony's OutputInterface.
62
*
@@ -363,6 +370,12 @@ protected function configure()
363
370
364
371
protected function execute(InputInterface $input, OutputInterface $output)
365
372
{
366
- call([$this, 'handle']);
373
+ if ($this->coroutine) {
374
+ go(function () {
375
+ call([$this, 'handle']);
376
+ });
377
+ return 0;
378
+ }
379
+ return call([$this, 'handle']);
367
380
}
368
381
0 commit comments