freddie
freddie copied to clipboard
Adding HubInterface to Command causes EventLoop to start during register_shutdown_function
Adding:
private HubInterface $hub;
public function __construct(HubInterface $hub)
{
parent::__construct();
$this->hub = $hub;
}
to any command causes symfony to hang prior finishing Command/Request. It happens due to registerShutdownFunction being registered and starting event loop run. Not sure what is the resolution. Symfony 5.4
https://ss.codeone.pl/ss-2024-06-15-18-52-52-1718470372-U51FCdgM.png
Example Command:
class TestMercureCommand extends Command
{
private HubInterface $hub;
public function __construct(HubInterface $hub)
{
parent::__construct();
$this->hub = $hub;
}
/**
* {@inheritdoc}
*/
protected function configure(): void
{
$this->setName('test:mercure');
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->write('test');
// no call to hub
return Command::SUCCESS;
}
Just a note - happens only with Redis as transport.