Kraken\Channel\Model\Zmq\Connection\ConnectionPool::removeInvalid PHP Метод

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

public removeInvalid ( ) : string[]
Результат string[]
    public function removeInvalid()
    {
        $toDel = [];
        $const = $this->generateConst();
        foreach ($this->connectionPool as $cid => $cdata) {
            if (!$this->validateIn($const, $cdata)) {
                $toDel[] = $cid;
            }
        }
        foreach ($toDel as $cid) {
            unset($this->connectionPool[$cid]);
        }
        return $toDel;
    }

Usage Example

Пример #1
0
 /**
  *
  */
 private function clearConnectionPool()
 {
     $deleted = $this->connectionPool->removeInvalid();
     foreach ($deleted as $deletedid) {
         $this->emit('disconnect', [$deletedid]);
     }
 }