Method | Description | |
---|---|---|
__construct ( $serverConfig ) | ||
__destruct ( ) | ||
changeMode ( $param ) | 更换连接模式,用于指定ip请求和普通请求切换 | |
clearAsyncData ( ) | clean up the async list and result | |
getAsyncData ( ) | ||
getConnectMode ( ) : array | 返回当前连接模式及相关信息 | |
getStat ( string $ip = "", string $port = "" ) : array | 获取应用服务器信息 get the backend service stat | |
multiAPI ( array $params, integer $mode = DoraConst::SW_MODE_WAITRESULT, integer $retry, string $ip = "", string $port = "" ) : mixed | 并发请求api,使用方法如 $params = array( "api_1117"=>array("name"=>"apiname1",“param”=>array("id"=>1117)), "api_2"=>array("name"=>"apiname2","param"=>array("id"=>2)), ) | |
reloadServerTask ( $ip = "", $port = "" ) | ||
singleAPI ( string $name, array $param, integer $mode = DoraConst::SW_MODE_WAITRESULT, integer $retry, string $ip = "", string $port = "" ) : mixed | 单api请求 |
Method | Description | |
---|---|---|
doRequest ( $sendData, $type ) | ||
generateGuid ( ) | ||
getClientObj ( ) | get current client | |
getConfigObjKey ( ) | random get config key | |
waitResult ( $client ) | return the right guid request |
public multiAPI ( array $params, integer $mode = DoraConst::SW_MODE_WAITRESULT, integer $retry, string $ip = "", string $port = "" ) : mixed | ||
$params | array | 提交参数 请指定key好方便区分对应结果,注意考虑到硬件资源有限并发请求不要超过50个 |
$mode | integer | |
$retry | integer | 通讯错误时重试次数 |
$ip | string | 要连得ip地址,如果不指定从现有配置随机个 |
$port | string | 要连得port地址,如果不指定从现有配置找一个 |
return | mixed | 返回指定key结果 |
public singleAPI ( string $name, array $param, integer $mode = DoraConst::SW_MODE_WAITRESULT, integer $retry, string $ip = "", string $port = "" ) : mixed | ||
$name | string | api地址 |
$param | array | 参数 |
$mode | integer | |
$retry | integer | 通讯错误时重试次数 |
$ip | string | 要连得ip地址,如果不指定从现有配置随机个 |
$port | string | 要连得port地址,如果不指定从现有配置找一个 |
return | mixed | 返回单个请求结果 |