\PG\MSF\PoolsIAsynPool

Interface IAsynPool

Summary

Methods
Constants
getAsynName()
distribute()
execute()
serverInit()
workerInit()
pushToPool()
prepareOne()
addTokenCallback()
getSync()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getAsynName()

getAsynName() : string

返回唯一的连接池名称

Returns

string

distribute()

distribute(array  $data) : $this

分发消息

Parameters

array $data

待分发数据

Returns

$this

execute()

execute(array  $data) 

执行命令

Parameters

array $data

命令相关信息

serverInit()

serverInit(\PG\MSF\MSFServer  $swooleServer, \PG\MSF\Pools\AsynPoolManager  $asynManager) : $this

初始化

Parameters

\PG\MSF\MSFServer $swooleServer

Server实例

\PG\MSF\Pools\AsynPoolManager $asynManager

异步连接池管理器

Returns

$this

workerInit()

workerInit(integer  $workerId) : $this

初始化workerId

Parameters

integer $workerId

worker进程ID

Returns

$this

pushToPool()

pushToPool(mixed  $client) : $this

归还连接

Parameters

mixed $client

连接对象

Returns

$this

prepareOne()

prepareOne() 

创建连接

addTokenCallback()

addTokenCallback(callable  $callback) : integer

注册回调

Parameters

callable $callback

回调函数

Returns

integer

getSync()

getSync() : mixed

获取同步连接

Throws

\Exception

Returns

mixed