<?php

namespace App\Tech\MessageHandler;

use App\Tech\Message\ProcessTaskMessage;
use Psr\Log\LoggerInterface;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
class ProcessTaskMessageHandler
{
    public function __construct(
        private LoggerInterface $logger,
    ) {
    }

    public function __invoke(ProcessTaskMessage $message): void
    {
        $this->logger->info('Processing task: ' . $message->getTaskName(), [
            'payload' => $message->getPayload(),
        ]);

        // Implement logic based on taskName here
    }
}
