/** * Removes and re-adds the client to the bucket. This way * the "requests" array does not get outdated and the clients, * are sorted by time. * * @param AlphaRPC\Manager\ClientHandler\Client $client * * @return \AlphaRPC\Manager\ClientHandler\ClientBucket */ public function refresh(Client $client) { $clientId = $client->getId(); $this->clients[$clientId] = $client; $this->removeClientForRequest($clientId, $client->getPreviousRequest()); $requestId = $client->getRequest(); if ($requestId !== null) { if (!isset($this->requests[$requestId])) { $this->requests[$requestId] = array(); } $this->requests[$requestId][$clientId] = $client; $this->clientRequest[$clientId] = $requestId; } return $this; }