\PG\MSF\PoolsAsynPoolManager

Class AsynPoolManager

Summary

Methods
Properties
Constants
__construct()
eventAdd()
noEventAdd()
getPipeMessage()
distribute()
registerAsyn()
writePipe()
sendMessageToWorker()
No public properties found
No constants found
No protected methods found
$swooleServer
$process
$registerDir
$notEventAdd
N/A
No private methods found
No private properties found
N/A

Properties

$swooleServer

$swooleServer : \PG\MSF\MSFServer

Type

\PG\MSF\MSFServer — server运行实例

$process

$process : \swoole_process

Type

\swoole_process — 连接池进程

$registerDir

$registerDir : array

Type

array — 已注册连接池

$notEventAdd

$notEventAdd : boolean

Type

boolean — 采用进程通讯,默认每个进程都启用进程池

Methods

__construct()

__construct(\swoole_process  $process, \PG\MSF\MSFServer  $swooleServer) 

AsynPoolManager constructor.

Parameters

\swoole_process $process

进程对象

\PG\MSF\MSFServer $swooleServer

Server运行实例

eventAdd()

eventAdd() : $this

采用额外进程的方式

Returns

$this

noEventAdd()

noEventAdd() : $this

不采用进程通讯,每个进程都启用进程池

Returns

$this

getPipeMessage()

getPipeMessage(integer  $pipe) : $this

算是管道消息

Parameters

integer $pipe

管道文件描述符号

Returns

$this

distribute()

distribute(array  $data) : $this

分发消息

Parameters

array $data

待分发数据

Returns

$this

registerAsyn()

registerAsyn(\PG\MSF\Pools\IAsynPool  $asyn) : $this

注册异步连接池

Parameters

\PG\MSF\Pools\IAsynPool $asyn

连接池对象

Returns

$this

writePipe()

writePipe(\PG\MSF\Pools\IAsynPool  $asyn, mixed  $data, integer  $workerId) : $this

写入管道

Parameters

\PG\MSF\Pools\IAsynPool $asyn

连接池对象

mixed $data

写入数据

integer $workerId

worker进程ID

Returns

$this

sendMessageToWorker()

sendMessageToWorker(\PG\MSF\Pools\IAsynPool  $asyn, mixed  $data) : $this

分发消息给worker

Parameters

\PG\MSF\Pools\IAsynPool $asyn

连接池对象

mixed $data

待分发数据

Returns

$this