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

Get
public get ( string $key ) : integer
$key string
Результат integer
Пример #1
0
 /**
  * Get Estimate (doesn't require lock)
  *
  * How long would I have to wait to make a request?
  *
  * @param string $key  - A unique key for what we're throttling
  * @param int $limit   - How many are allowed
  * @param int $milliseconds - In this many milliseconds
  * @return int - the number of milliseconds before this request should be allowed
  * to pass
  */
 public function getEstimate($key, $limit, $milliseconds)
 {
     $key = $this->getStorageKey($key, $limit, $milliseconds);
     $count = $this->storage->get($key);
     if ($count < $limit) {
         return 0;
     }
     return $milliseconds - microtime(1) * 1000 % (double) $milliseconds;
 }
Пример #2
0
 /**
  * Get Last Request
  *
  * @param string $key
  * @return float
  */
 protected function getLastRequest($key)
 {
     return $this->storage->get($key . '::LASTREQUEST');
 }