Skip to content
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 of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip phases #131

Merged
merged 4 commits into from
Apr 29, 2024
Merged

Skip phases #131

merged 4 commits into from
Apr 29, 2024

Conversation

DanielCoulbourne
Copy link
Contributor

@DanielCoulbourne DanielCoulbourne commented Apr 29, 2024

This PR adds a Verbs::skipPhases() method that causes Verbs not to execute any hooks for one or more phases.

Useful when testing or for certain weird business logic (in our case, ephemeral event queues)

Usage

Verbs::skipPhases(Phase::Apply, Phase::Handle);

This will cause all hooks for the Apply and Handle phases (like the apply() and handle() methods of many events) not to fire.

To reset skipped phases just call the method with no arguments.

Verbs::skipPhases();

Copy link
Collaborator

@joshhanley joshhanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Maybe a way to reset might be helpful?

@DanielCoulbourne DanielCoulbourne merged commit e7490dd into main Apr 29, 2024
@DanielCoulbourne DanielCoulbourne deleted the skip-hooks branch April 29, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants