private function checkDaemonLimits(): void
    {
        if ($this->isShutdown) {
            throw new ShutdownException($this->shutdownMessage);
        }

        pcntl_signal_dispatch();

        if (DaemonOptions::NO_LIMIT !== $this->requestLimit) {
            if ($this->requestLimit <= $this->requestCount) {
                throw new ShutdownException('Daemon request limit reached ('.$this->requestCount.' of '.$this->requestLimit.')');
            }
        }

        if (DaemonOptions::NO_LIMIT !== $this->memoryLimit) {
            $memoryUsage = memory_get_usage(true);

            if ($this->memoryLimit <= $memoryUsage) {
                throw new ShutdownException('Daemon memory limit reached ('.$memoryUsage.' of '.$this->memoryLimit.' bytes)');
            }
        }
    }
private function checkDaemonLimits(): void
    {
        if ($this->isShutdown) {
            throw new ShutdownException($this->shutdownMessage);
        }

        pcntl_signal_dispatch();

        if (DaemonOptions::NO_LIMIT !== $this->requestLimit) {
            if ($this->requestLimit <= $this->requestCount) {
                throw new ShutdownException('Daemon request limit reached ('.$this->requestCount.' of '.$this->requestLimit.')');
            }
        }

        if (DaemonOptions::NO_LIMIT !== $this->memoryLimit) {
            $memoryUsage = memory_get_usage(true);

            if ($this->memoryLimit <= $memoryUsage) {
                throw new ShutdownException('Daemon memory limit reached ('.$memoryUsage.' of '.$this->memoryLimit.' bytes)');
            }
        }
    }
private function checkDaemonLimits ( ) : void { if ( $ this -> isShutdown ) { throw new ShutdownException ( $ this -> shutdownMessage ) ; } pcntl_signal_dispatch ( ) ; if ( DaemonOptions :: NO_LIMIT !== $ this -> requestLimit ) { if ( $ this -> requestLimit <= $ this -> requestCount ) { throw new ShutdownException ( 'Daemon request limit reached (' . $ this -> requestCount . ' of ' . $ this -> requestLimit . ')' ) ; } } if ( DaemonOptions :: NO_LIMIT !== $ this -> memoryLimit ) { $ memoryUsage = memory_get_usage ( true ) ; if ( $ this -> memoryLimit <= $ memoryUsage ) { throw new ShutdownException ( 'Daemon memory limit reached (' . $ memoryUsage . ' of ' . $ this -> memoryLimit . ' bytes)' ) ; } } }
Checks the current PHP process against the limits specified in a daemon
options object. This function will also throw an exception if the daemon
has been flagged for shutdown.

@throws ShutdownException When limits in the daemon options are exceeded
Checks the current PHP process against the limits specified in a daemon options object . This function will also throw an exception if the daemon has been flagged for shutdown .