WordPress at Your Fingertips
function is not described

ActionScheduler_ActionFactory::async() public WC 1.0

Enqueue an action to run one time, as soon as possible (rather a specific scheduled time).

This method creates a new action with the NULLSchedule. This schedule maps to a MySQL datetime string of
0000-00-00 00:00:00. This is done to create a psuedo "async action" type that is fully backward compatible. Existing queries to claim actions claim by date, meaning actions scheduled for 0000-00-00 00:00:00 will always be claimed prior to actions scheduled for a specific date. This makes sure that any async action is given priority in queue processing. This has the added advantage of making sure async actions can be claimed by both the existing WP Cron and WP CLI runners, as well as a new async request runner.

{} It's a method of the class: ActionScheduler_ActionFactory{}

No Hooks.

Return

Int. The ID of the stored action

Usage

$ActionScheduler_ActionFactory = new ActionScheduler_ActionFactory();
$ActionScheduler_ActionFactory->async( $hook, $args, $group );
$hook(string) (required)
The hook to trigger when this action runs
$args(array)
Args to pass when the hook is triggered
Default: array()
$group(string)
A group to put the action in
Default: ''

Code of ActionScheduler_ActionFactory::async() WC 6.1.0

public function async( $hook, $args = array(), $group = '' ) {
	$schedule = new ActionScheduler_NullSchedule();
	$action = new ActionScheduler_Action( $hook, $args, $schedule, $group );
	return $this->store( $action );
}