Skip to content

Adding HubInterface to Command causes EventLoop to start during register_shutdown_function #35

@fliespl

Description

@fliespl

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;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions