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

Allow multiple events subscription with regexp #3512

Merged

Conversation

spaghetticode
Copy link
Member

@spaghetticode spaghetticode commented Feb 13, 2020

Ref #3481

Spree::Event events can now be subscribed also using regexp event names, when using the default ActiveSupportNotification adapter.
As ActiveSupportNotification can manage regexp when subscribing to events, it makes sense to allow Spree::Event to leverage this feature.

Every specific adapter can decide independently their supported event name types.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

@spaghetticode spaghetticode added the type:enhancement Proposed or newly added feature label Feb 13, 2020
@spaghetticode spaghetticode self-assigned this Feb 13, 2020
Copy link
Contributor

@skukx skukx left a comment

Choose a reason for hiding this comment

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

This looks great, just a few thoughts on difference in behavior depending on type

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Left a comment about the discussion happened, let me know!

@spaghetticode
Copy link
Member Author

While working on this PR I noticed the illogic situation exposed in #3519. I think that PR needs attention and to be merged before this one.

@spaghetticode spaghetticode force-pushed the spaghetticode/regexp-event-subscription branch from 052fcbe to cadf034 Compare February 28, 2020 11:22
`Spree::Event` events can now be subscribed also using regexp event names,
when using the default  ActiveSupportNotification adapter.
As ActiveSupportNotification can manage regexp when subscribing to events,
it makes sense to allow `Spree::Event` to leverage this feature.

Every specific adapter can decide independently their supported event name
types.
The documentation now includes explanations on using Regexp
for subscribing to multiple events and its gotcha.
@spaghetticode spaghetticode force-pushed the spaghetticode/regexp-event-subscription branch from cadf034 to 3c3475e Compare February 28, 2020 11:33
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Thanks, @spaghetticode!

@spaghetticode spaghetticode merged commit 647cb8d into solidusio:master Mar 12, 2020
@spaghetticode spaghetticode deleted the spaghetticode/regexp-event-subscription branch March 12, 2020 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants