PHP Class DistributedClient, zys

Show file Open project: qieangel2013/zys Class Usage Examples

Public Properties

Property Type Description
$application
$b_client_pool
$c_client_pool
$instance

Public Methods

Method Description
__construct ( )
addServerClient ( $address )
appendserlist ( $data, $score, $keyname = 'Distributed' ) 添加到分布式服务器列表
delkey ( $keyname = 'errser' ) 删除错误服务器
getInstance ( ) 单例
geterrlist ( $data ) 定时获取移除的服务器
getkey ( $keyname = 'errser' ) 获取错误服务器
getserlist ( $keyname = 'Distributed' ) 获取分布式服务器列表
onClose ( $client ) 服务器断开连接
onConnect ( $serv )
onError ( $client ) 服务器连接失败
onFinish ( $serv, $task_id, $data )
onReceive ( $client, $data )
onTask ( $serv, $task_id, $from_id, $data )
removeuser ( $data, $keyname = 'Distributed' ) 从分布式服务器列表删除
setkey ( $data, $keyname = 'errser' ) 设置错误服务器

Method Details

__construct() public method

public __construct ( )

addServerClient() public method

public addServerClient ( $address )

appendserlist() public method

添加到分布式服务器列表
public appendserlist ( $data, $score, $keyname = 'Distributed' )

delkey() public method

删除错误服务器
public delkey ( $keyname = 'errser' )

getInstance() public static method

单例
public static getInstance ( )

geterrlist() public method

定时获取移除的服务器
public geterrlist ( $data )

getkey() public method

获取错误服务器
public getkey ( $keyname = 'errser' )

getserlist() public method

获取分布式服务器列表
public getserlist ( $keyname = 'Distributed' )

onClose() public method

服务器断开连接
public onClose ( $client )

onConnect() public method

public onConnect ( $serv )

onError() public method

服务器连接失败
public onError ( $client )

onFinish() public method

public onFinish ( $serv, $task_id, $data )

onReceive() public method

public onReceive ( $client, $data )

onTask() public method

public onTask ( $serv, $task_id, $from_id, $data )

removeuser() public method

从分布式服务器列表删除
public removeuser ( $data, $keyname = 'Distributed' )

setkey() public method

设置错误服务器
public setkey ( $data, $keyname = 'errser' )

Property Details

$application public property

public $application

$b_client_pool public property

public $b_client_pool

$c_client_pool public property

public $c_client_pool

$instance public static property

public static $instance