PHP 클래스 WpGears\Gearman\Client

상속: extends WpGears\Client
파일 보기 프로젝트 열기: 10up/wp-gears

공개 프로퍼티들

프로퍼티 타입 설명
$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