Last active
November 25, 2023 15:53
-
-
Save EdouardCourty/33cb816f27187591a00fbb61c3e610d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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