Thruway\Registration::processCall PHP Метод

processCall() публичный Метод

Process call
public processCall ( Call $call )
$call Call
    public function processCall(Call $call)
    {
        if ($call->getRegistration() !== null) {
            throw new \Exception("Registration already set when asked to process call");
        }
        $call->setRegistration($this);
        $this->calls[] = $call;
        $this->session->incPendingCallCount();
        $callCount = count($this->calls);
        if ($callCount == 1) {
            // we just became busy
            $this->busyStart = microtime(true);
        }
        if ($callCount > $this->maxSimultaneousCalls) {
            $this->maxSimultaneousCalls = $callCount;
        }
        $this->invocationCount++;
        $this->lastCallStartedAt = new \DateTime();
        $this->getSession()->sendMessage($call->getInvocationMessage());
    }

Usage Example

Пример #1
0
 public function testMakingCallIncrementsCallCount()
 {
     $mockSession = $this->getMockBuilder('\\Thruway\\Session')->setConstructorArgs([new \Thruway\Transport\DummyTransport()])->getMock();
     $this->assertEquals(0, $this->_registration->getCurrentCallCount());
     $callMsg = new \Thruway\Message\CallMessage(\Thruway\Session::getUniqueId(), new \stdClass(), 'test_procedure');
     $call = new \Thruway\Call($mockSession, $callMsg);
     $this->_registration->processCall($call);
     $this->assertEquals(1, $this->_registration->getCurrentCallCount());
 }
All Usage Examples Of Thruway\Registration::processCall