PHP Class WpGears\Gearman\Client

Inheritance: extends WpGears\Client
Afficher le fichier Open project: 10up/wp-gears

Méthodes publiques

Свойство Type Description
$gearman_client The libGearman Client instance
$gearman_servers The list of Gearman Servers to connect to.

Méthodes publiques

Méthode Description
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.

Method Details

add() public méthode

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
Résultat boolean true or false depending on the Client

get_async_group() public méthode

The Function Group used to split libGearman functions on a multi-network install.
public get_async_group ( ) : string
Résultat string The prefixed group name

get_background_method() public méthode

Returns the libGearman function to use based on the specified priority.
public get_background_method ( string $priority ) : string
$priority string low, normal or high
Résultat string The corresponding method name

get_blog_id() public méthode

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
Résultat integer | false The current blog ids id.

get_gearman_client() public méthode

Builds the libGearman Client Instance if the extension is installed. Once created returns the previous instance without reinitialization.
public get_gearman_client ( ) : GearmanClient | false
Résultat GearmanClient | false An instance of GearmanClient

get_servers() public méthode

If absent the default server will be used.
public get_servers ( ) : array
Résultat array The list of servers for this Worker.

register() public méthode

Creates a new libGearman Client instances and configures the servers that it should connect to.
public register ( ) : boolean
Résultat boolean True or false if successful

Property Details

$gearman_client public_oe property

The libGearman Client instance
public $gearman_client

$gearman_servers public_oe property

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