0 follower

Trait Yiisoft\Queue\Cli\SoftLimitTrait

Implemented byYiisoft\Queue\Cli\SignalLoop, Yiisoft\Queue\Cli\SimpleLoop

Method Details

Hide inherited methods

getMemoryLimit() protected abstract method

protected abstract integer getMemoryLimit ( )

                abstract protected function getMemoryLimit(): int;

            
memoryLimitReached() protected method

protected boolean memoryLimitReached ( )

                protected function memoryLimitReached(): bool
{
    $limit = $this->getMemoryLimit();
    if ($limit !== 0) {
        $usage = memory_get_usage(true);
        if ($usage >= $limit) {
            return true;
        }
    }
    return false;
}