Odesk\Phystrix\RequestCache::clearAll PHP Method

clearAll() public method

Clears the cache for a given commandKey only
public clearAll ( string $commandKey )
$commandKey string
    public function clearAll($commandKey)
    {
        if (isset($this->cachedResults[$commandKey])) {
            unset($this->cachedResults[$commandKey]);
        }
    }

Usage Example

Example #1
0
 public function testClearAll()
 {
     $result = (object) array('a' => 123);
     $this->requestCache->put('TestCommand', 'cache-key-123', $result);
     $this->assertEquals($result, $this->requestCache->get('TestCommand', 'cache-key-123'));
     $this->requestCache->clearAll('TestCommand');
     $this->assertNull($this->requestCache->get('TestCommand', 'cache-key-123'));
 }