- Messenger, Mercure
- chapter download flow (lelscan only)
This commit is contained in:
Jérémy Guillot
2024-06-13 18:11:11 +02:00
parent f88fa2c232
commit bc85649789
24 changed files with 744 additions and 78 deletions

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Service;
use Symfony\Component\Mercure\HubInterface;
use Symfony\Component\Mercure\Update;
class NotificationService
{
public function __construct(private HubInterface $hub)
{
}
public function sendUpdate(string $topic, mixed $data): void
{
$update = new Update($topic, json_encode($data));
$this->hub->publish($update);
}
}