public function processQueue()
    {
        if (!$this->getAllowMultipleRegistrations()) {
            throw new \Exception('Queuing only allowed when there are multiple registrations');
        }

        // find the best candidate
        while ($this->callQueue->count() > 0) {
            $registration = NULL;

            if (strcasecmp($this->getInvokeType(), Registration::FIRST_REGISTRATION) === 0) {
                $registration = $this->getNextFirstRegistration();
            } else if (strcasecmp($this->getInvokeType(), Registration::LAST_REGISTRATION) === 0) {
                $registration = $this->getNextLastRegistration();
            } else if (strcasecmp($this->getInvokeType(), Registration::RANDOM_REGISTRATION) === 0) {
                $registration = $this->getNextRandomRegistration();
            } else if (strcasecmp($this->getInvokeType(), Registration::ROUNDROBIN_REGISTRATION) === 0) {
                $registration = $this->getNextRoundRobinRegistration();
            } else if (strcasecmp($this->getInvokeType(), Registration::THRUWAY_REGISTRATION) === 0) {
                $registration = $this->getNextThruwayRegistration();
            }

            if ($registration === NULL) {
                break;
            }
            $call = $this->callQueue->dequeue();
            $registration->processCall($call);
        }
    }
public function processQueue()
    {
        if (!$this->getAllowMultipleRegistrations()) {
            throw new \Exception('Queuing only allowed when there are multiple registrations');
        }

        // find the best candidate
        while ($this->callQueue->count() > 0) {
            $registration = NULL;

            if (strcasecmp($this->getInvokeType(), Registration::FIRST_REGISTRATION) === 0) {
                $registration = $this->getNextFirstRegistration();
            } else if (strcasecmp($this->getInvokeType(), Registration::LAST_REGISTRATION) === 0) {
                $registration = $this->getNextLastRegistration();
            } else if (strcasecmp($this->getInvokeType(), Registration::RANDOM_REGISTRATION) === 0) {
                $registration = $this->getNextRandomRegistration();
            } else if (strcasecmp($this->getInvokeType(), Registration::ROUNDROBIN_REGISTRATION) === 0) {
                $registration = $this->getNextRoundRobinRegistration();
            } else if (strcasecmp($this->getInvokeType(), Registration::THRUWAY_REGISTRATION) === 0) {
                $registration = $this->getNextThruwayRegistration();
            }

            if ($registration === NULL) {
                break;
            }
            $call = $this->callQueue->dequeue();
            $registration->processCall($call);
        }
    }
public function processQueue ( ) { if ( ! $ this -> getAllowMultipleRegistrations ( ) ) { throw new \ Exception ( 'Queuing only allowed when there are multiple registrations' ) ; } // find the best candidate while ( $ this -> callQueue -> count ( ) > 0 ) { $ registration = NULL ; if ( strcasecmp ( $ this -> getInvokeType ( ) , Registration :: FIRST_REGISTRATION ) === 0 ) { $ registration = $ this -> getNextFirstRegistration ( ) ; } else if ( strcasecmp ( $ this -> getInvokeType ( ) , Registration :: LAST_REGISTRATION ) === 0 ) { $ registration = $ this -> getNextLastRegistration ( ) ; } else if ( strcasecmp ( $ this -> getInvokeType ( ) , Registration :: RANDOM_REGISTRATION ) === 0 ) { $ registration = $ this -> getNextRandomRegistration ( ) ; } else if ( strcasecmp ( $ this -> getInvokeType ( ) , Registration :: ROUNDROBIN_REGISTRATION ) === 0 ) { $ registration = $ this -> getNextRoundRobinRegistration ( ) ; } else if ( strcasecmp ( $ this -> getInvokeType ( ) , Registration :: THRUWAY_REGISTRATION ) === 0 ) { $ registration = $ this -> getNextThruwayRegistration ( ) ; } if ( $ registration === NULL ) { break ; } $ call = $ this -> callQueue -> dequeue ( ) ; $ registration -> processCall ( $ call ) ; } }
Process the Queue

@throws \Exception
Process the Queue