PHPDaemon\Clients\Redis\Lock::release PHP Method

release() public method

public release ( callable $cb = null ) : this
$cb callable
return this
    public function release($cb = null)
    {
        $this->pool->eval('if redis.call("get",KEYS[1]) == ARGV[1] then return redis.call("del",KEYS[1]) else return 0 end', 1, $this->key, $this->token, function ($redis) use($cb) {
            if ($cb !== null) {
                $cb($this, $redis->result, $redis);
            }
        });
        return $this;
    }