Skip to content

Instantly share code, notes, and snippets.

@EdouardCourty
Last active November 25, 2023 15:53
Show Gist options
  • Save EdouardCourty/33cb816f27187591a00fbb61c3e610d2 to your computer and use it in GitHub Desktop.
Save EdouardCourty/33cb816f27187591a00fbb61c3e610d2 to your computer and use it in GitHub Desktop.
<?php
namespace App\Schedule;
use Symfony\Component\Scheduler\Attribute\AsSchedule;
use Symfony\Component\Scheduler\RecurringMessage;
use App\Message\ExampleMessage;
#[AsSchedule('main')]
class MainScheduler implements ScheduleProviderInterface
{
public function getSchedule(): Schedule
{
return (new Schedule())->add(
RecurringMessage::every('2 days', new ExampleMessage())
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment