\Object_Sync_Sf_Queue

Object_Sync_Sf_Queue

Manage the queue

Summary

Methods
Properties
Constants
__construct()
action_scheduler_batch_size()
action_scheduler_concurrent_batches()
get_frequencies()
get_frequency()
add()
schedule_single()
schedule_recurring()
schedule_cron()
cancel()
get_next()
search()
No public properties found
No constants found
No protected methods found
$wpdb
$version
$slug
$option_prefix
$schedulable_classes
N/A
add_actions()
No private properties found
N/A

Properties

$wpdb

$wpdb : 

Type

$version

$version : 

Type

$slug

$slug : 

Type

$option_prefix

$option_prefix : 

Type

$schedulable_classes

$schedulable_classes : 

Type

Methods

__construct()

__construct(  $wpdb,   $version,   $slug,   $option_prefix,   $schedulable_classes) 

Parameters

$wpdb
$version
$slug
$option_prefix
$schedulable_classes
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

action_scheduler_batch_size()

action_scheduler_batch_size(integer  $batch_size) : integer

Set the batch size.

Parameters

integer $batch_size
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

integer —

$batch_size

action_scheduler_concurrent_batches()

action_scheduler_concurrent_batches(integer  $concurrent_batches) : integer

Set the number of concurrent batches that can run.

Parameters

integer $concurrent_batches
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

integer —

$concurrent_batches

get_frequencies()

get_frequencies(string  $unit = 'seconds', string  $sort = 'asc') : array

Get all the schedules with their frequencies, sorted

Parameters

string $unit

The unit of time

string $sort

Which direction to sort

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

array —

$this->schedulable_classes

get_frequency()

get_frequency(string  $name, string  $unit) : integer

Get a single schedule item's frequency

Parameters

string $name

The name of the schedule

string $unit

The unit of time

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

integer —

How often it runs in that unit of time

add()

add(string  $hook, array  $args = array(), string  $group = '') : string

Enqueue an action to run one time, as soon as possible

Parameters

string $hook

The hook to trigger.

array $args

Arguments to pass when the hook triggers.

string $group

The group to assign this job to.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

string —

The action ID.

schedule_single()

schedule_single(integer  $timestamp, string  $hook, array  $args = array(), string  $group = '') : string

Schedule an action to run once at some time in the future

Parameters

integer $timestamp

When the job will run.

string $hook

The hook to trigger.

array $args

Arguments to pass when the hook triggers.

string $group

The group to assign this job to.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

string —

The action ID.

schedule_recurring()

schedule_recurring(integer  $timestamp, integer  $interval_in_seconds, string  $hook, array  $args = array(), string  $group = '') : string

Schedule a recurring action

Parameters

integer $timestamp

When the first instance of the job will run.

integer $interval_in_seconds

How long to wait between runs.

string $hook

The hook to trigger.

array $args

Arguments to pass when the hook triggers.

string $group

The group to assign this job to.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

string —

The action ID.

schedule_cron()

schedule_cron(integer  $timestamp, string  $cron_schedule, string  $hook, array  $args = array(), string  $group = '') : string

Schedule an action that recurs on a cron-like schedule.

Parameters

integer $timestamp

The schedule will start on or after this time.

string $cron_schedule

A cron-link schedule string.

string $hook

The hook to trigger.

array $args

Arguments to pass when the hook triggers.

string $group

The group to assign this job to.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

string —

The action ID

cancel()

cancel(string  $hook, array  $args = array(), string  $group = '') 

Dequeue all actions with a matching hook (and optionally matching args and group) so they are not run.

Any recurring actions with a matching hook will also be cancelled, not just the next scheduled action.

Technically, one action in a recurring or Cron action is scheduled at any one point in time. The next in the sequence is scheduled after the previous one is run, so only the next scheduled action needs to be cancelled/dequeued to stop the sequence.

Parameters

string $hook

The hook that the job will trigger.

array $args

Args that would have been passed to the job.

string $group

Group name.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

get_next()

get_next(string  $hook, array  $args = null, string  $group = '') : \time|null

Get the date and time for the next scheduled occurence of an action with a given hook (an optionally that matches certain args and group), if any.

Parameters

string $hook

Hook name.

array $args

Arguments.

string $group

Group name.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

\time|null —

The date and time for the next occurrence, or null if there is no pending, scheduled action for the given hook.

search()

search(array  $args = array(), string  $return_format = OBJECT) : array

Find scheduled actions

Parameters

array $args

Possible arguments, with their default values: 'hook' => '' - the name of the action that will be triggered 'args' => null - the args array that will be passed with the action 'date' => null - the scheduled date of the action. Expects a DateTime object, a unix timestamp, or a string that can parsed with strtotime(). Used in UTC timezone. 'date_compare' => '<=' - operator for testing "date". accepted values are '!=', '>', '>=', '<', '<=', '=' 'modified' => null - the date the action was last updated. Expects a DateTime object, a unix timestamp, or a string that can parsed with strtotime(). Used in UTC timezone. 'modified_compare' => '<=' - operator for testing "modified". accepted values are '!=', '>', '>=', '<', '<=', '=' 'group' => '' - the group the action belongs to 'status' => '' - ActionScheduler_Store::STATUS_COMPLETE or ActionScheduler_Store::STATUS_PENDING 'claimed' => null - TRUE to find claimed actions, FALSE to find unclaimed actions, a string to find a specific claim ID 'per_page' => 5 - Number of results to return 'offset' => 0 'orderby' => 'date' - accepted values are 'hook', 'group', 'modified', or 'date' 'order' => 'ASC'.

string $return_format

OBJECT, ARRAY_A, or ids.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

array

add_actions()

add_actions() 

Add actions

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293