public function init(ConnectionInterface $conn = null, $runlevel = ApplicationServerInterface::FULL)
    {

        // switch to the new runlevel
        $this->synchronized(function ($self, $newRunlevel) {
            // wait till the previous commands has been finished
            while ($self->locked === true) {
                sleep(1);
            }

            // set the command name
            $self->command = InitCommand::COMMAND;

            // lock process
            $self->locked = true;
            $self->params = $newRunlevel;

            // notify the AS to execute the command
            $self->notify();

        }, $this, $runlevel);
    }
public function init(ConnectionInterface $conn = null, $runlevel = ApplicationServerInterface::FULL)
    {

        // switch to the new runlevel
        $this->synchronized(function ($self, $newRunlevel) {
            // wait till the previous commands has been finished
            while ($self->locked === true) {
                sleep(1);
            }

            // set the command name
            $self->command = InitCommand::COMMAND;

            // lock process
            $self->locked = true;
            $self->params = $newRunlevel;

            // notify the AS to execute the command
            $self->notify();

        }, $this, $runlevel);
    }
public function init ( ConnectionInterface $ conn = null , $ runlevel = ApplicationServerInterface :: FULL ) { // switch to the new runlevel $ this -> synchronized ( function ( $ self , $ newRunlevel ) { // wait till the previous commands has been finished while ( $ self -> locked === true ) { sleep ( 1 ) ; } // set the command name $ self -> command = InitCommand :: COMMAND ; // lock process $ self -> locked = true ; $ self -> params = $ newRunlevel ; // notify the AS to execute the command $ self -> notify ( ) ; } , $ this , $ runlevel ) ; }
The runlevel to switch to.

@param \React\Socket\ConnectionInterface $conn     The connection resource
@param integer                           $runlevel The new runlevel to switch to

@return void
The runlevel to switch to .