public static function every(string|int|\DateInterval
$frequency, object
$message, string|\DateTimeImmutable
$from = null, string|\DateTimeImmutable
$until =
new \
DateTimeImmutable('3000-01-01'
)): self
{ return self::
trigger(new PeriodicalTrigger($frequency,
$from,
$until),
$message);
} /**
* @param MessageProviderInterface|object $message A message provider that yields messages or a static message that will be dispatched on every trigger
*/
public static function cron(string
$expression, object
$message, \DateTimeZone|string
$timezone = null
): self
{ if (!
str_contains($expression, '#'
)) { return self::
trigger(CronExpressionTrigger::
fromSpec($expression, null,
$timezone),
$message);
} if (!
$message instanceof \Stringable
) { throw new InvalidArgumentException('A message must be stringable to use "hashed" cron expressions.'
);
} return self::
trigger(CronExpressionTrigger::
fromSpec($expression,
(string) $message,
$timezone),
$message);
} /**
* @param MessageProviderInterface|object $message A message provider that yields messages or a static message that will be dispatched on every trigger
*/