\Dreamcat\ConfigClient\Api\ImplApolloServer

apollo服务器对象

Summary

Methods
Properties
Constants
__construct()
getServerUrl()
setServerUrl()
getQueryTimeoutMs()
setQueryTimeoutMs()
getPullWaitTimeoutMs()
setPullWaitTimeoutMs()
getConfig()
notifications()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$serverUrl
$queryTimeoutMs
$pullWaitTimeoutMs
$httpClient
N/A

Properties

$serverUrl

$serverUrl : string

Type

string — 服务器地址

$queryTimeoutMs

$queryTimeoutMs : integer

Type

integer — 常规查询超时时长,ms

$pullWaitTimeoutMs

$pullWaitTimeoutMs : integer

Type

integer — long pull的超时时长

$httpClient

$httpClient : \Dreamcat\Http\EnhanceClient\Share\RestHttpClient

Type

\Dreamcat\Http\EnhanceClient\Share\RestHttpClient

Methods

__construct()

__construct(string  $serverUrl) 

ApolloServer constructor.

Parameters

string $serverUrl

getServerUrl()

getServerUrl() : string

Returns

string —

服务器地址

setServerUrl()

setServerUrl(string  $serverUrl) : static

Parameters

string $serverUrl

服务器地址

Returns

static —

对象本身

getQueryTimeoutMs()

getQueryTimeoutMs() : integer

Returns

integer —

常规查询超时时长

setQueryTimeoutMs()

setQueryTimeoutMs(integer  $queryTimeoutMs) : static

Parameters

integer $queryTimeoutMs

常规查询超时时长

Returns

static —

对象本身

getPullWaitTimeoutMs()

getPullWaitTimeoutMs() : integer

Returns

integer —

long pull的超时时长

setPullWaitTimeoutMs()

setPullWaitTimeoutMs(integer  $pullWaitTimeoutMs) : static

Parameters

integer $pullWaitTimeoutMs

long pull的超时时长,ms,必须大于65000

Returns

static —

对象本身

getConfig()

getConfig(\Dreamcat\ConfigClient\Api\Impl\string  $appid, \Dreamcat\ConfigClient\Api\Impl\string  $clusterName, \Dreamcat\ConfigClient\Api\Impl\string  $namespaceName, \Dreamcat\ConfigClient\Api\Impl\string  $ip = null, \Dreamcat\ConfigClient\Api\Impl\string  $releaseKey = null) : \Dreamcat\ConfigClient\Popo\ApolloConfigResult

获取配置

Parameters

\Dreamcat\ConfigClient\Api\Impl\string $appid

应用的appId

\Dreamcat\ConfigClient\Api\Impl\string $clusterName

集群名

\Dreamcat\ConfigClient\Api\Impl\string $namespaceName

Namespace的名字

\Dreamcat\ConfigClient\Api\Impl\string $ip

应用部署的机器ip

\Dreamcat\ConfigClient\Api\Impl\string $releaseKey

上一次的releaseKey

Returns

\Dreamcat\ConfigClient\Popo\ApolloConfigResult

notifications()

notifications(\Dreamcat\ConfigClient\Api\Impl\string  $appid, \Dreamcat\ConfigClient\Api\Impl\string  $clusterName, array  $notifications) : array

应用感知配置更新

Parameters

\Dreamcat\ConfigClient\Api\Impl\string $appid

应用ID

\Dreamcat\ConfigClient\Api\Impl\string $clusterName

集群名

array $notifications

键是namespace,值是最新的通知id

Returns

array —

有变化的情况,键是namespace,值是最新的通知id