ActionScheduler_NullSchedule

ActionScheduler_NullSchedule represents an async action with no scheduled date. It intentionally has no run time and is used for actions that should run as soon as the queue runner can process them.

Class definition

class ActionScheduler_NullSchedule extends ActionScheduler_SimpleSchedule {
	public function __construct( ?DateTime $date = null );
	public function __sleep();
	public function __wakeup();
}

When it’s used

Use this schedule for async actions where no specific run time is stored. In the Action Scheduler core, a NullSchedule indicates a pending async action (get_date() returns null).

Next-run calculation

  • get_date() returns null because there is no scheduled date.
  • calculate_next() is inherited from ActionScheduler_SimpleSchedule and returns null.
  • get_next( DateTime $after ) (from ActionScheduler_Abstract_Schedule) will always return null because the stored schedule date is null.

Recurrence

  • is_recurring() is inherited from ActionScheduler_SimpleSchedule and returns false.

Serialization behavior

__sleep() returns an empty array and __wakeup() resets the scheduled date to null, since there is no DateTime instance to serialize.