Odesk\Phystrix\RequestCache::put PHP Method

put() public method

Puts request result into cache for a given command type
public put ( string $commandKey, string $cacheKey, mixed $result )
$commandKey string
$cacheKey string
$result mixed
    public function put($commandKey, $cacheKey, $result)
    {
        $this->cachedResults[$commandKey][$cacheKey] = $result;
    }

Usage Example

Example #1
0
 public function testExists()
 {
     $result = (object) array('a' => 123);
     $this->assertFalse($this->requestCache->exists('TestCommand', 'cache-key-123'));
     $this->requestCache->put('TestCommand', 'cache-key-123', $result);
     $this->assertTrue($this->requestCache->exists('TestCommand', 'cache-key-123'));
 }
All Usage Examples Of Odesk\Phystrix\RequestCache::put