<?php

namespace App\MessageHandler;

use App\Message\GenerateTasksMessage;
use App\Service\TaskGenerator;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
final class GenerateTasksMessageHandler
{
    public function __construct(private TaskGenerator $generator)
    {
    }

    public function __invoke(GenerateTasksMessage $message): void
    {
        $this->generator->generateNewTasks();
    }
}
