Skip to content

feat: schedule through Action Scheduler - #1

Merged
ogorzalka merged 2 commits into
mainfrom
feat/action-scheduler-driver
Oct 13, 2026
Merged

ogorzalka merged 2 commits into
mainfrom
feat/action-scheduler-driver

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Step 2 of the pollora/schedule work: the Action Scheduler driver.

  • ActionSchedulerDriver: own group, single and recurring events, the core's ten-minute duplicate window.
  • Schedule::driver() / POLLORA_SCHEDULE_DRIVER / Schedule::extend(); WordPress's scheduling functions follow the driver through the pre_* filters (CronInterceptor).
  • Two stores coexist until the migration: events in the cron option, protected hooks (action_scheduler_run_queue, protect(), filter) and an unavailable driver stay on WP-Cron; a new event goes to the driver. pre_get_scheduled_event answers null, never false, so the core still reads the option.
  • Events scheduled before action_scheduler_init are buffered and given once.
  • The contract ScheduleDriver is unchanged; DefersUntilReady and FindsEvent are optional.

68 tests, PHPStan 0, Pint, lowest/stable. On pollora-test (develop + the framework PR, package linked), one wp eval-file process with Action Scheduler (WooCommerce) ready: the plugin pattern if (! wp_next_scheduled()) wp_schedule_event() run twice leaves one action; wp_next_scheduled() and wp_get_scheduled_event() read it; wp_version_check stays visible and is not duplicated; a duplicate single event answers duplicate_event; wp_clear_scheduled_hook() removes ours and leaves another plugin's action on the same hook; nothing is left behind and the cron option is unchanged.

ActionSchedulerDriver (own group, single and recurring events, the core's ten-minute duplicate window), a driver chosen by name or POLLORA_SCHEDULE_DRIVER that WordPress's scheduling functions follow through the pre_* filters, protected hooks, a buffer until Action Scheduler is ready, and WP-Cron for what it already holds or the driver cannot take.
@ogorzalka
ogorzalka merged commit 54d0331 into main Oct 13, 2026
6 checks passed
@ogorzalka
ogorzalka deleted the feat/action-scheduler-driver branch October 13, 2026 13:21
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.

1 participant