\Imi\Server\ConnectContextStoreHandler

连接上下文存储处理器-总

Summary

Methods
Properties
Constants
read()
save()
destroy()
delayDestroy()
exists()
lock()
unlock()
getHandler()
getTtl()
No public properties found
No constants found
No protected methods found
$handlerClass
$ttl
N/A
No private methods found
No private properties found
N/A

Properties

$handlerClass

$handlerClass : string

处理器类

Type

string

$ttl

$ttl : integer

数据有效期,单位:秒 连接断开后,供断线重连的,数据保留时间 设为 0 则连接断开立即销毁数据

Type

integer

Methods

read()

read(string  $key) : array

读取数据

Parameters

string $key

Returns

array

save()

save(string  $key, array  $data) : void

保存数据

Parameters

string $key
array $data

destroy()

destroy(string  $key) : void

销毁数据

Parameters

string $key

delayDestroy()

delayDestroy(string  $key, integer  $ttl) : void

延迟销毁数据

Parameters

string $key
integer $ttl

exists()

exists(string  $key) : void

数据是否存在

Parameters

string $key

lock()

lock(string  $key, callable  $callable = null) : boolean

加锁

Parameters

string $key
callable $callable

Returns

boolean

unlock()

unlock() : boolean

解锁

Returns

boolean

getTtl()

getTtl() : integer

Get 设为 0 则连接断开立即销毁数据

Returns

integer