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

Support prioritization of actions / groups #236

Closed
rrennick opened this issue Feb 13, 2019 · 4 comments
Closed

Support prioritization of actions / groups #236

rrennick opened this issue Feb 13, 2019 · 4 comments
Labels
category: performance The issue/PR is related to performance. type: enhancement The issue is a request for an enhancement.
Milestone

Comments

@rrennick
Copy link
Collaborator

In the WC #core chat there was some discussion about expanding the capabilities of Action Scheduler around the increasing number of scheduled tasks.

The WooCommerce Admin plugin uses scheduled tasks to maintain lookup & statistical tables for the new dashboard. They have asked that we look into implementing queuing/groups and/or a priority system.

After some discussion with @thenbrent and reviewing the current codebase & custom tables plugin, I have the following proposal for discussion:

  1. Implement a priority system using 10 as the default priority (consistent with WP hook priority)
  2. Expand groups to allow
    -- programatic registration
    -- user defined via the dashboard
    -- default priority for the group
  3. Update the custom tables to reflect 1 & 2
  4. Implement custom tables (Custom Action Scheduler database tables #77) with limited backward compatibility (ie. new functionality is only available with custom tables)
@thenbrent
Copy link
Contributor

2. Expand groups

I really like the idea of using Groups to manage priority vs using hooks. 💯

Subscriptions doesn't use groups (yet), so existing stores using wouldn't benefit from that. We can change that easily enough though for future actions. We can also make sure webhooks and WC Admin, which are using groups, use a priority > the default as well so that subscription actions are still run.

4. new functionality is only available with custom tables

That sounds like a smart approach to me.

@pmgarman
Copy link

pmgarman commented Mar 8, 2019

I support this implementation.

Thoughts - when you have something like the high volume plugin running and you're running multiple "threads"... the ability to specify some of those threads to specific groups/queues would be interesting. In a case like this where there is infrastructure to support it, having dedicated subscription threads and dedicated wc admin threads / etc could be useful. I'm sure the WP CLI commands will support running against specific groups though so maybe that will be enough. Our large sites we run cron via WP CLI anyways for a variety of reasons.

@rrennick
Copy link
Collaborator Author

rrennick commented Mar 8, 2019

@pmgarman Thanks, good suggestions. Adding group support to the high volume plugin could probably be added to that plugin independently of the changes happening here.

Currently, the WP CLI command only supports a single group but adding support for multiple groups would be a nice enhancement.

@rrennick rrennick added the hasPR label May 6, 2019
@rrennick rrennick added this to the 3.0.0 milestone Jun 6, 2019
@thenbrent thenbrent changed the title Accomodate for increased use of scheduled actions Support prioritization of actions Jul 4, 2019
@thenbrent thenbrent changed the title Support prioritization of actions Support prioritization of actions / groups Jul 4, 2019
@thenbrent thenbrent modified the milestones: 3.0.0, 3.1.0 Jul 24, 2019
@rrennick rrennick modified the milestones: 3.1.0, 3.2.0 Feb 21, 2020
@rrennick
Copy link
Collaborator Author

Closing this as we haven't seen a situation with 3.X where this was needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: performance The issue/PR is related to performance. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

3 participants