\adminmatrix\swoole\concernsInteractsWithServer

Trait InteractsWithServer

Summary

Methods
Properties
Constants
addBatchWorker()
addWorker()
start()
getWorkerId()
getPool()
sendMessage()
runWithBarrier()
$container
No constants found
stopWorker()
createPool()
addHotUpdateProcess()
clearCache()
setProcessName()
$startFuncMap
$workerId
$pool
$ipc
N/A
No private methods found
No private properties found
N/A

Properties

$container

$container : \think\App

Type

\think\App

$startFuncMap

$startFuncMap : array

Type

array

$workerId

$workerId

$pool

$pool : \Swoole\Process\Pool

Type

\Swoole\Process\Pool —

$ipc

$ipc : \adminmatrix\swoole\Ipc

Type

Ipc

Methods

addBatchWorker()

addBatchWorker(int  $workerNum, callable  $func, mixed  $name = null) : mixed

Parameters

int $workerNum
callable $func
mixed $name

Returns

mixed —

addWorker()

addWorker(callable  $func, mixed  $name = null) : self

Parameters

callable $func
mixed $name

Returns

self —

start()

start(string  $envName) : void

启动服务

Parameters

string $envName

环境变量标识

getWorkerId()

getWorkerId() : mixed

Returns

mixed —

getPool()

getPool() : \Swoole\Process\Pool

获取当前工作进程池对象

Returns

\Swoole\Process\Pool —

sendMessage()

sendMessage(mixed  $workerId, mixed  $message) : mixed

Parameters

mixed $workerId
mixed $message

Returns

mixed —

runWithBarrier()

runWithBarrier(callable  $func, mixed  ...$params) : mixed

Parameters

callable $func
mixed $params variadic

Returns

mixed —

stopWorker()

stopWorker() : mixed

Returns

mixed —

createPool()

createPool(mixed  $workerNum) : mixed

Parameters

mixed $workerNum

Returns

mixed —

addHotUpdateProcess()

addHotUpdateProcess() : mixed

热更新

Returns

mixed —

clearCache()

clearCache() : mixed

清除apc、op缓存

Returns

mixed —

setProcessName()

setProcessName( $process) : mixed

Set process name.

Parameters

$process

Returns

mixed —