Documentation

WpCronDriver
in package
implements JobSchedulerInterface

FinalYes

Pure WP-Cron job driver — the zero-dependency fallback.

Enqueues each job as a wp_schedule_single_event at the current timestamp, so it runs on the next cron spawn. WP-Cron is a pseudo-cron (it only fires on traffic unless a real system cron drives wp-cron.php), gives no retry, no claiming and no admin UI — production hosts that need those guarantees should run Action Scheduler (ActionSchedulerDriver); the outbox layer above compensates for lost events by re-listing undelivered rows.

Table of Contents

Interfaces

JobSchedulerInterface
Contract for enqueuing one-off async jobs on a WordPress host.

Methods

enqueue()  : bool
Enqueue a one-off job for as-soon-as-possible async execution.

Methods

enqueue()

Enqueue a one-off job for as-soon-as-possible async execution.

public enqueue(string $hook[, array<string|int, mixed> $args = [] ]) : bool
Parameters
$hook : string

the action hook the job fires

$args : array<string|int, mixed> = []

positional arguments passed to the hook listener; must be distinct per job under WP-Cron (identical hook+args pairs within ten minutes are suppressed)

Return values
bool —

true when the job was accepted by the backend

On this page

Search results