PHP Класс WpGears\Gearman\Client

Наследование: extends WpGears\Client
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$gearman_client The libGearman Client instance
$gearman_servers The list of Gearman Servers to connect to.

Открытые методы

Метод Описание
add ( string $hook, array $args = [], string $priority = 'normal' ) : boolean Adds a Job to the libGearman Client's Queue.
get_async_group ( ) : string The Function Group used to split libGearman functions on a multi-network install.
get_background_method ( string $priority ) : string Returns the libGearman function to use based on the specified priority.
get_blog_id ( ) : integer | false Caches and returns the current blog id for adding to the Job meta data. False if not a multisite install.
get_gearman_client ( ) : GearmanClient | false Builds the libGearman Client Instance if the extension is installed. Once created returns the previous instance without reinitialization.
get_servers ( ) : array The Gearman Servers to connect to as defined in wp-config.php.
register ( ) : boolean Creates a new libGearman Client instances and configures the servers that it should connect to.

Описание методов

add() публичный Метод

Adds a Job to the libGearman Client's Queue.
public add ( string $hook, array $args = [], string $priority = 'normal' ) : boolean
$hook string The action hook name for the job
$args array Optional arguments for the job
$priority string Optional priority of the job
Результат boolean true or false depending on the Client

get_async_group() публичный Метод

The Function Group used to split libGearman functions on a multi-network install.
public get_async_group ( ) : string
Результат string The prefixed group name

get_background_method() публичный Метод

Returns the libGearman function to use based on the specified priority.
public get_background_method ( string $priority ) : string
$priority string low, normal or high
Результат string The corresponding method name

get_blog_id() публичный Метод

Caches and returns the current blog id for adding to the Job meta data. False if not a multisite install.
public get_blog_id ( ) : integer | false
Результат integer | false The current blog ids id.

get_gearman_client() публичный Метод

Builds the libGearman Client Instance if the extension is installed. Once created returns the previous instance without reinitialization.
public get_gearman_client ( ) : GearmanClient | false
Результат GearmanClient | false An instance of GearmanClient

get_servers() публичный Метод

If absent the default server will be used.
public get_servers ( ) : array
Результат array The list of servers for this Worker.

register() публичный Метод

Creates a new libGearman Client instances and configures the servers that it should connect to.
public register ( ) : boolean
Результат boolean True or false if successful

Описание свойств

$gearman_client публичное свойство

The libGearman Client instance
public $gearman_client

$gearman_servers публичное свойство

The list of Gearman Servers to connect to.
public $gearman_servers