Jamm\Memory\Shm\SHMObject::del_old PHP Method

del_old() public method

Delete old (by ttl) variables from storage (map)
public del_old ( ) : boolean
return boolean
    public function del_old()
    {
        $auto_unlocker = NULL;
        if (!$this->mutex->get_access_write($auto_unlocker)) {
            return false;
        }
        $r = 0;
        $map = $this->mem_object->read('map');
        $todel = array();
        foreach ($map as $k => &$v) {
            if (!empty($v[self::map_key_ttl]) && $v[self::map_key_ttl] < time()) {
                $todel[] = $k;
            }
        }
        if (!empty($todel)) {
            $r = $this->del($todel);
        }
        return $r;
    }