interface Lock

Lock 抽象接口

Methods

setExpire(int $expire = 100)

设置锁的过期时间

mixed
lock(string $key, bool $wouldBlock = false)

上锁

void
unlock(string $key)

解锁

Details

at line 25
Redis setExpire(int $expire = 100)

设置锁的过期时间

Parameters

int $expire

Return Value

Redis | \Cml\Lock\Memcache | \Cml\Lock\File

at line 35
mixed lock(string $key, bool $wouldBlock = false)

上锁

Parameters

string $key 要解锁的锁的key
bool $wouldBlock 是否堵塞

Return Value

mixed

at line 44
void unlock(string $key)

解锁

Parameters

string $key

Return Value

void