Kraken\Channel\Protocol\ProtocolInterface::getTimestamp PHP Метод

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

Return protocol timestamp.
public getTimestamp ( ) : integer
Результат integer
    public function getTimestamp();

Usage Example

Пример #1
0
 /**
  * @param ProtocolInterface
  * @return bool
  */
 protected function handleReceiveRequest(ProtocolInterface $protocol)
 {
     if ($protocol->getType() === Channel::TYPE_REQ && $protocol->getDestination() === $this->name) {
         $pid = $protocol->getPid();
         $timestamp = $protocol->getTimestamp();
         $now = $this->getTime();
         if ($timestamp <= $now || $this->existsResponse($pid)) {
             return true;
         }
         $timestamp -= 5000.0;
         $this->addResponse($pid, $this->createResponse($pid, $protocol->getOrigin(), $timestamp, $timestamp - $now));
     }
     return false;
 }