Documentation

Pool
in package

Table of Contents

Methods

__construct()  : mixed
构造
__destruct()  : mixed
析构等待销毁
append()  : void
追加
create()  : array<string|int, Pool>
初始化
destroy()  : void
回收
exists()  : bool
区域/区域对象是否存在
get()  : Pool|array<string|int, Pool>|null
获取
getElement()  : resource|object|array<string|int, mixed>|mixed|null
获取元素
getIndex()  : int
所在区域的索引
getName()  : string
获取所在区域名称
idle()  : Pool|null
获取空闲池
init()  : void
初始化占位
isClone()  : bool
是否是深拷贝
isForce()  : bool
是否强制回收
isIdle()  : bool
是否闲置
setForce()  : void
设置强制回收
setIdle()  : void
设置状态
wait()  : void
等待至闲置
waitForIdle()  : mixed
等待空闲并执行

Methods

__construct()

构造

public __construct(string $name, int $index, object|array<string|int, mixed>|resource|mixed $element[, bool $clone = true ]) : mixed
Parameters
$name : string

区域名称

$index : int

区域索引

$element : object|array<string|int, mixed>|resource|mixed

元素

$clone : bool = true

是否执行深拷贝

__destruct()

析构等待销毁

public __destruct() : mixed

append()

追加

public static append(string $name, int $index, mixed $element) : void
Parameters
$name : string
$index : int
$element : mixed

create()

初始化

public static create(string $name, int $count, mixed $element[, bool $clone = true ]) : array<string|int, Pool>
Parameters
$name : string

区域

$count : int

区域索引

$element : mixed

元素

$clone : bool = true

是否开启深拷贝

Return values
array<string|int, Pool>

destroy()

回收

public static destroy(string $name, int|null $index[, bool $force = false ]) : void
Parameters
$name : string
$index : int|null
$force : bool = false

exists()

区域/区域对象是否存在

public static exists(string $name, int|null $index) : bool
Parameters
$name : string
$index : int|null
Return values
bool

get()

获取

public static get(string $name, int|null $index) : Pool|array<string|int, Pool>|null
Parameters
$name : string
$index : int|null
Return values
Pool|array<string|int, Pool>|null

getElement()

获取元素

public getElement() : resource|object|array<string|int, mixed>|mixed|null
Return values
resource|object|array<string|int, mixed>|mixed|null

getIndex()

所在区域的索引

public getIndex() : int
Return values
int

getName()

获取所在区域名称

public getName() : string
Return values
string

idle()

获取空闲池

public static idle(string $name) : Pool|null
Parameters
$name : string
Return values
Pool|null

init()

初始化占位

public static init(string $name[, bool $clone = true ]) : void
Parameters
$name : string
$clone : bool = true

isClone()

是否是深拷贝

public isClone() : bool
Return values
bool

isForce()

是否强制回收

public isForce() : bool
Return values
bool

isIdle()

是否闲置

public isIdle() : bool
Return values
bool

setForce()

设置强制回收

public setForce(bool $force) : void
Parameters
$force : bool

setIdle()

设置状态

public setIdle(bool $idle) : void
Parameters
$idle : bool

wait()

等待至闲置

public wait([Closure|null $closure = null ]) : void
Parameters
$closure : Closure|null = null

需要执行的逻辑 = function ($this) }

waitForIdle()

等待空闲并执行

public static waitForIdle(string $name, Closure $closure[, int $timeout = -1 ]) : mixed
Parameters
$name : string

池区域

$closure : Closure

被执行函数 = function (Pool $pool) }

$timeout : int = -1

超时时间


        
On this page

Search results