\Dreamcat\ConfigClient\ImplConfigCenterReadProcess

apollo配置进程

Summary

Methods
Properties
Constants
__construct()
getTryCount()
setTryCount()
getLogger()
setLogger()
setConfigServerLintener()
setConfigSaver()
readConfig()
No public properties found
No constants found
getAppInfoKey()
getAppInfoByKey()
buildVersions()
saveCache()
No protected properties found
N/A
No private methods found
$configServerLintener
$configSaver
$cacheFile
$cache
$logger
$tryCount
N/A

Properties

$cacheFile

$cacheFile : string

Type

string — 缓存文件名

$cache

$cache : array

Type

array — 最后一次拉到配置的版本信息,键是应用关键字的序列化信息,值是版本号

$logger

$logger : \Psr\Log\LoggerInterface

Type

\Psr\Log\LoggerInterface — 日志记录器

$tryCount

$tryCount : integer

Type

integer — 拉配置失败的重试次数

Methods

__construct()

__construct(string  $cacheFile) 

ApolloReadProcess constructor.

Parameters

string $cacheFile

读取配置的缓存文件,要确保有读写权限

getTryCount()

getTryCount() : integer

Returns

integer —

拉配置失败的重试次数

setTryCount()

setTryCount(integer  $tryCount) : static

Parameters

integer $tryCount

拉配置失败的重试次数

Returns

static —

对象本身

getLogger()

getLogger() : \Psr\Log\LoggerInterface

Returns

\Psr\Log\LoggerInterface —

日志记录器

setLogger()

setLogger(\Psr\Log\LoggerInterface  $logger) : static

Parameters

\Psr\Log\LoggerInterface $logger

日志记录器

Returns

static —

对象本身

setConfigServerLintener()

setConfigServerLintener(\Dreamcat\ConfigClient\ConfigCenterListener  $configCenterListener) : static

设置服务器

Parameters

\Dreamcat\ConfigClient\ConfigCenterListener $configCenterListener

配置中心监听器

Returns

static —

对象本身

setConfigSaver()

setConfigSaver(\Dreamcat\ConfigClient\ConfigSaverInterface  $configSaver) : static

设置配置保存器

Parameters

\Dreamcat\ConfigClient\ConfigSaverInterface $configSaver

配置保存器

Returns

static —

对象本身

readConfig()

readConfig() : void

开始读取配置

getAppInfoKey()

getAppInfoKey(mixed  $appInfo) : string

获取应用key

Parameters

mixed $appInfo

应用信息

Returns

string —

key字符串

getAppInfoByKey()

getAppInfoByKey(string  $appKey) : mixed

通过应用key获取应用信息

Parameters

string $appKey

应用key

Returns

mixed —

应用信息

buildVersions()

buildVersions() : array<mixed,\Dreamcat\ConfigClient\Popo\ConfigVersion>

从缓存构建版本信息

Returns

array<mixed,\Dreamcat\ConfigClient\Popo\ConfigVersion> —

键是应用key,值是版本信息

saveCache()

saveCache() : void

将缓存内容存入缓存文件