Method | Description | |
---|---|---|
get_event ( $timestamp, $action_hashed, $instance ) | Find an event's data using its hashed representations | |
get_events ( ) | List events pending for the current period | |
get_lock_key_for_event_action ( $event ) : string | Turn the event action into a string that can be used with a lock | |
prepare_environment ( ) | Prepare environment to run job | |
run_event ( $timestamp, $action, $instance, $force = false ) : array | WP_Error | Execute a specific event |
Method | Description | |
---|---|---|
class_init ( ) | Register hooks |
Method | Description | |
---|---|---|
action_has_callback_or_should_run_anyway ( $event ) : boolean | Check that an event has a callback to run, and allow the check to be overridden Empty events are, by default, skipped and removed/rescheduled | |
can_run_event ( $event ) : boolean | Are resources available to run this event? | |
do_lock_cleanup ( $event ) | Free locks after event completes | |
prime_event_action_lock ( $event ) | Prime the event-specific lock | |
reduce_queue ( $events ) : array | Trim events queue down to the limit set by JOB_QUEUE_SIZE | |
reset_event_lock ( $event ) : boolean | Frees the lock for an individual event | |
update_event_record ( $event ) | Mark an event completed, and reschedule when requested |
public get_event ( $timestamp, $action_hashed, $instance ) |
public get_lock_key_for_event_action ( $event ) : string | ||
$event | array Event data | |
return | string |
public prepare_environment ( ) |
public run_event ( $timestamp, $action, $instance, $force = false ) : array | WP_Error | ||
$timestamp | int Unix timestamp | |
$action | string md5 hash of the action used when the event is registered | |
$instance | string md5 hash of the event's arguments array, which Core uses to index the `cron` option | |
$force | bool Run event regardless of timestamp or lock status? eg, when executing jobs via wp-cli | |
return | array | WP_Error |