public function monitor()
    {
        if (! $this->process->isStarted()) {
            return $this->restart();
        }

        // First, we will check to see if the supervisor failed as a duplicate and if
        // it did we will go ahead and mark it as dead. We will do this before the
        // other checks run because we do not care if this is cooling down here.
        if (! $this->process->isRunning() &&
            $this->process->getExitCode() === 13) {
            return $this->markAsDead();
        }

        // If the process is running or cooling down from a failure, we don't need to
        // attempt to do anything right now, so we can just bail out of the method
        // here and it will get checked out during the next master monitor loop.
        if ($this->process->isRunning() ||
            $this->coolingDown()) {
            return;
        }

        // Next, we will determine if the exit code is one that means this supervisor
        // should be marked as dead and not be restarted. Typically, this could be
        // an indication that the supervisor was simply purposefully terminated.
        $exitCode = $this->process->getExitCode();

        $this->markAsDead();

        // If the supervisor exited with a status code that we do not restart on then
        // we will not attempt to restart it. Otherwise, we will need to provision
        // it back out based on the latest provisioning information we have now.
        if (in_array($exitCode, $this->dontRestartOn)) {
            return;
        }

        $this->reprovision();
    }
public function monitor()
    {
        if (! $this->process->isStarted()) {
            return $this->restart();
        }

        // First, we will check to see if the supervisor failed as a duplicate and if
        // it did we will go ahead and mark it as dead. We will do this before the
        // other checks run because we do not care if this is cooling down here.
        if (! $this->process->isRunning() &&
            $this->process->getExitCode() === 13) {
            return $this->markAsDead();
        }

        // If the process is running or cooling down from a failure, we don't need to
        // attempt to do anything right now, so we can just bail out of the method
        // here and it will get checked out during the next master monitor loop.
        if ($this->process->isRunning() ||
            $this->coolingDown()) {
            return;
        }

        // Next, we will determine if the exit code is one that means this supervisor
        // should be marked as dead and not be restarted. Typically, this could be
        // an indication that the supervisor was simply purposefully terminated.
        $exitCode = $this->process->getExitCode();

        $this->markAsDead();

        // If the supervisor exited with a status code that we do not restart on then
        // we will not attempt to restart it. Otherwise, we will need to provision
        // it back out based on the latest provisioning information we have now.
        if (in_array($exitCode, $this->dontRestartOn)) {
            return;
        }

        $this->reprovision();
    }
public function monitor ( ) { if ( ! $ this -> process -> isStarted ( ) ) { return $ this -> restart ( ) ; } // First, we will check to see if the supervisor failed as a duplicate and if // it did we will go ahead and mark it as dead. We will do this before the // other checks run because we do not care if this is cooling down here. if ( ! $ this -> process -> isRunning ( ) && $ this -> process -> getExitCode ( ) === 13 ) { return $ this -> markAsDead ( ) ; } // If the process is running or cooling down from a failure, we don't need to // attempt to do anything right now, so we can just bail out of the method // here and it will get checked out during the next master monitor loop. if ( $ this -> process -> isRunning ( ) || $ this -> coolingDown ( ) ) { return ; } // Next, we will determine if the exit code is one that means this supervisor // should be marked as dead and not be restarted. Typically, this could be // an indication that the supervisor was simply purposefully terminated. $ exitCode = $ this -> process -> getExitCode ( ) ; $ this -> markAsDead ( ) ; // If the supervisor exited with a status code that we do not restart on then // we will not attempt to restart it. Otherwise, we will need to provision // it back out based on the latest provisioning information we have now. if ( in_array ( $ exitCode , $ this -> dontRestartOn ) ) { return ; } $ this -> reprovision ( ) ; }
Evaluate the current state of the process.

@return void
Evaluate the current state of the process .