fomo-framework / fomo

A simple, fast framework with many features for the HTTP
MIT License
147 stars 12 forks source link

Swoole\Event::rshutdown(): Event::wait() in shutdown function is deprecated in Unknown on line 0 #6

Closed a950216t closed 1 year ago

a950216t commented 1 year ago

Using scheduling:start in the latest version of swoole or openswoole I get the following error:

PHP Deprecated:  Swoole\Event::rshutdown(): Event::wait() in shutdown function is deprecated in Unknown on line 0
PHP Stack trace:
PHP   1. {main}() /data/wwwroot/fomo/engineer:0
PHP   2. Symfony\Component\Console\Application->run($input = *uninitialized*, $output = *uninitialized*) /data/wwwroot/fomo/engineer:98
PHP   3. Symfony\Component\Console\Application->doRun($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 1; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'scheduling:start']; protected $interactive = TRUE; private array $tokens = [0 => 'scheduling:start']; private array $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private bool $decorated = TRUE; private array $styles = [...]; private Symfony\Component\Console\Formatter\OutputFormatterStyleStack $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private Symfony\Component\Console\Output\OutputInterface $stderr = class Symfony\Component\Console\Output\StreamOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private array $consoleSectionOutputs = [] }) /data/wwwroot/fomo/vendor/symfony/console/Application.php:168
PHP   4. Symfony\Component\Console\Application->doRunCommand($command = class Fomo\Commands\Scheduling\Start { private ?Symfony\Component\Console\Application ${Symfony\Component\Console\Command\Command}application = class Symfony\Component\Console\Application { private array $commands = [...]; private bool $wantHelps = FALSE; private ?Symfony\Component\Console\Command\Command $runningCommand = ...; private string $name = 'UNKNOWN'; private string $version = 'UNKNOWN'; private ?Symfony\Component\Console\CommandLoader\CommandLoaderInterface $commandLoader = NULL; private bool $catchExceptions = TRUE; private bool $autoExit = TRUE; private Symfony\Component\Console\Input\InputDefinition $definition = class Symfony\Component\Console\Input\InputDefinition { ... }; private Symfony\Component\Console\Helper\HelperSet $helperSet = class Symfony\Component\Console\Helper\HelperSet { ... }; private ?Symfony\Contracts\EventDispatcher\EventDispatcherInterface $dispatcher = NULL; private Symfony\Component\Console\Terminal $terminal = class Symfony\Component\Console\Terminal { ... }; private string $defaultCommand = 'list'; private bool $singleCommand = FALSE; private bool $initialized = TRUE; private Symfony\Component\Console\SignalRegistry\SignalRegistry $signalRegistry = class Symfony\Component\Console\SignalRegistry\SignalRegistry { ... }; private array $signalsToDispatchEvent = [...] }; private ?string ${Symfony\Component\Console\Command\Command}name = 'scheduling:start'; private ?string ${Symfony\Component\Console\Command\Command}processTitle = NULL; private array ${Symfony\Component\Console\Command\Command}aliases = []; private Symfony\Component\Console\Input\InputDefinition ${Symfony\Component\Console\Command\Command}definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 0; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; private bool ${Symfony\Component\Console\Command\Command}hidden = FALSE; private string ${Symfony\Component\Console\Command\Command}help = ''; private string ${Symfony\Component\Console\Command\Command}description = 'start scheduling server'; private ?Symfony\Component\Console\Input\InputDefinition ${Symfony\Component\Console\Command\Command}fullDefinition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 1; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; private bool ${Symfony\Component\Console\Command\Command}ignoreValidationErrors = FALSE; private ?Closure ${Symfony\Component\Console\Command\Command}code = NULL; private array ${Symfony\Component\Console\Command\Command}synopsis = []; private array ${Symfony\Component\Console\Command\Command}usages = []; private ?Symfony\Component\Console\Helper\HelperSet ${Symfony\Component\Console\Command\Command}helperSet = class Symfony\Component\Console\Helper\HelperSet { private array $helpers = [...] } }, $input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 1; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'scheduling:start']; protected $interactive = TRUE; private array $tokens = [0 => 'scheduling:start']; private array $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private bool $decorated = TRUE; private array $styles = [...]; private Symfony\Component\Console\Formatter\OutputFormatterStyleStack $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private Symfony\Component\Console\Output\OutputInterface $stderr = class Symfony\Component\Console\Output\StreamOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private array $consoleSectionOutputs = [] }) /data/wwwroot/fomo/vendor/symfony/console/Application.php:314
PHP   5. Symfony\Component\Console\Command\Command->run($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 1; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'scheduling:start']; protected $interactive = TRUE; private array $tokens = [0 => 'scheduling:start']; private array $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private bool $decorated = TRUE; private array $styles = [...]; private Symfony\Component\Console\Formatter\OutputFormatterStyleStack $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private Symfony\Component\Console\Output\OutputInterface $stderr = class Symfony\Component\Console\Output\StreamOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private array $consoleSectionOutputs = [] }) /data/wwwroot/fomo/vendor/symfony/console/Application.php:1022
PHP   6. Fomo\Commands\Scheduling\Start->execute($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 1; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'scheduling:start']; protected $interactive = TRUE; private array $tokens = [0 => 'scheduling:start']; private array $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private bool $decorated = TRUE; private array $styles = [...]; private Symfony\Component\Console\Formatter\OutputFormatterStyleStack $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private Symfony\Component\Console\Output\OutputInterface $stderr = class Symfony\Component\Console\Output\StreamOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private array $consoleSectionOutputs = [] }) /data/wwwroot/fomo/vendor/symfony/console/Command/Command.php:312
PHP   7. Fomo\Servers\Scheduling->start() /data/wwwroot/fomo/vendor/fomo/framework/src/Commands/Scheduling/Start.php:41
PHP   8. Swoole\Process->start() /data/wwwroot/fomo/vendor/fomo/framework/src/Servers/Scheduling.php:46
PHP   9. Swoole\Event::rshutdown() Unknown:0

Deprecated: Swoole\Event::rshutdown(): Event::wait() in shutdown function is deprecated in Unknown on line 0

Call Stack:
    0.0002    1434160   1. {main}() /data/wwwroot/fomo/engineer:0
    0.0203    3892392   2. Symfony\Component\Console\Application->run($input = ???, $output = ???) /data/wwwroot/fomo/engineer:98
    0.0261    4194672   3. Symfony\Component\Console\Application->doRun($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 1; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'scheduling:start']; protected $interactive = TRUE; private array $tokens = [0 => 'scheduling:start']; private array $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private bool $decorated = TRUE; private array $styles = [...]; private Symfony\Component\Console\Formatter\OutputFormatterStyleStack $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private Symfony\Component\Console\Output\OutputInterface $stderr = class Symfony\Component\Console\Output\StreamOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private array $consoleSectionOutputs = [] }) /data/wwwroot/fomo/vendor/symfony/console/Application.php:168
    0.0263    4198672   4. Symfony\Component\Console\Application->doRunCommand($command = class Fomo\Commands\Scheduling\Start { private ?Symfony\Component\Console\Application ${Symfony\Component\Console\Command\Command}application = class Symfony\Component\Console\Application { private array $commands = [...]; private bool $wantHelps = FALSE; private ?Symfony\Component\Console\Command\Command $runningCommand = ...; private string $name = 'UNKNOWN'; private string $version = 'UNKNOWN'; private ?Symfony\Component\Console\CommandLoader\CommandLoaderInterface $commandLoader = NULL; private bool $catchExceptions = TRUE; private bool $autoExit = TRUE; private Symfony\Component\Console\Input\InputDefinition $definition = class Symfony\Component\Console\Input\InputDefinition { ... }; private Symfony\Component\Console\Helper\HelperSet $helperSet = class Symfony\Component\Console\Helper\HelperSet { ... }; private ?Symfony\Contracts\EventDispatcher\EventDispatcherInterface $dispatcher = NULL; private Symfony\Component\Console\Terminal $terminal = class Symfony\Component\Console\Terminal { ... }; private string $defaultCommand = 'list'; private bool $singleCommand = FALSE; private bool $initialized = TRUE; private Symfony\Component\Console\SignalRegistry\SignalRegistry $signalRegistry = class Symfony\Component\Console\SignalRegistry\SignalRegistry { ... }; private array $signalsToDispatchEvent = [...] }; private ?string ${Symfony\Component\Console\Command\Command}name = 'scheduling:start'; private ?string ${Symfony\Component\Console\Command\Command}processTitle = NULL; private array ${Symfony\Component\Console\Command\Command}aliases = []; private Symfony\Component\Console\Input\InputDefinition ${Symfony\Component\Console\Command\Command}definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 0; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; private bool ${Symfony\Component\Console\Command\Command}hidden = FALSE; private string ${Symfony\Component\Console\Command\Command}help = ''; private string ${Symfony\Component\Console\Command\Command}description = 'start scheduling server'; private ?Symfony\Component\Console\Input\InputDefinition ${Symfony\Component\Console\Command\Command}fullDefinition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 1; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; private bool ${Symfony\Component\Console\Command\Command}ignoreValidationErrors = FALSE; private ?Closure ${Symfony\Component\Console\Command\Command}code = NULL; private array ${Symfony\Component\Console\Command\Command}synopsis = []; private array ${Symfony\Component\Console\Command\Command}usages = []; private ?Symfony\Component\Console\Helper\HelperSet ${Symfony\Component\Console\Command\Command}helperSet = class Symfony\Component\Console\Helper\HelperSet { private array $helpers = [...] } }, $input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 1; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'scheduling:start']; protected $interactive = TRUE; private array $tokens = [0 => 'scheduling:start']; private array $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private bool $decorated = TRUE; private array $styles = [...]; private Symfony\Component\Console\Formatter\OutputFormatterStyleStack $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private Symfony\Component\Console\Output\OutputInterface $stderr = class Symfony\Component\Console\Output\StreamOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private array $consoleSectionOutputs = [] }) /data/wwwroot/fomo/vendor/symfony/console/Application.php:314
    0.0263    4198672   5. Symfony\Component\Console\Command\Command->run($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 1; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'scheduling:start']; protected $interactive = TRUE; private array $tokens = [0 => 'scheduling:start']; private array $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private bool $decorated = TRUE; private array $styles = [...]; private Symfony\Component\Console\Formatter\OutputFormatterStyleStack $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private Symfony\Component\Console\Output\OutputInterface $stderr = class Symfony\Component\Console\Output\StreamOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private array $consoleSectionOutputs = [] }) /data/wwwroot/fomo/vendor/symfony/console/Application.php:1022
    0.0264    4200432   6. Fomo\Commands\Scheduling\Start->execute($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 1; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'scheduling:start']; protected $interactive = TRUE; private array $tokens = [0 => 'scheduling:start']; private array $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private bool $decorated = TRUE; private array $styles = [...]; private Symfony\Component\Console\Formatter\OutputFormatterStyleStack $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private Symfony\Component\Console\Output\OutputInterface $stderr = class Symfony\Component\Console\Output\StreamOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private array $consoleSectionOutputs = [] }) /data/wwwroot/fomo/vendor/symfony/console/Command/Command.php:312
    0.0280    4338656   7. Fomo\Servers\Scheduling->start() /data/wwwroot/fomo/vendor/fomo/framework/src/Commands/Scheduling/Start.php:41
    0.0281    4339360   8. Swoole\Process->start() /data/wwwroot/fomo/vendor/fomo/framework/src/Servers/Scheduling.php:46
    0.0465    7177904   9. Swoole\Event::rshutdown() Unknown:0
amirfaramarzi commented 1 year ago

hi a950216t

Please send your task codes and "App\Scheduling\Kernel" file codes as well (all files in the "App\Scheduling" path)

a950216t commented 1 year ago

App\Scheduling\Kernel:

<?php

namespace App\Scheduling;

use Fomo\Scheduling\Scheduler;
use App\Scheduling\Tasks\TestTask;

class Kernel
{
    public function tasks(): void
    {
        (new Scheduler())->call(TestTask::class)->everyMinutes();
    }
}

App\Scheduling\Tasks\TestTask:

<?php

namespace App\Scheduling\Tasks;

use Fomo\Database\DB;

class TestTask
{
    public function handle(): void
    {
        DB::table('cache')->truncate();
    }
}

The code works but throws deprecated errors.