8000 [Scheduler] Add `AbstractTriggerDecorator` by kbond · Pull Request #51152 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Scheduler] Add AbstractTriggerDecorator #51152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms 8000 of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2023
Merged

Conversation

kbond
Copy link
Member
@kbond kbond commented Jul 28, 2023
Q A
Branch? 6.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets n/a
License MIT
Doc PR n/a

I have a need to know what trigger decorators are used and what the real trigger is.

This PR adds an AbstractTriggerDecorator that the current decorators (Jitter & ExcludeTime) extend.

$trigger = new ExcludeTimeTrigger(new JitterTrigger(CronExpressionTrigger::fromSpec('#midnight', new MyMessage()));

$trigger->inner(); // CronExpressionTrigger
$trigger->decorators(); // [ExcludeTimeTrigger, JitterTrigger]

@kbond kbond force-pushed the decorated-trigger branch from 4eef909 to 3ca7eb3 Compare July 28, 2023 20:06
@fabpot
Copy link
Member
fabpot commented Jul 29, 2023

Can you tell use more about your use case?

@kbond
Copy link
Member Author
kbond commented Jul 29, 2023

Sure!

  1. I'm building a scheduler dashboard and would like to translate cron strings to a human readable format. I need to find the inner-most trigger to do this.
  2. A scheduler monitoring service I'm building an integration for only supports cron expressions. It's ok to use with a jitter wrapped cron, but not an exclude time wrapped cron.

@fabpot
Copy link
Member
fabpot commented Jul 31, 2023

Thank you @kbond.

@fabpot fabpot merged commit 62904a6 into symfony:6.4 Jul 31, 2023
@kbond kbond deleted the decorated-trigger branch July 31, 2023 12:19
This was referenced Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0