startCallback() public method

start() using a callable. Same as start()/c()/end().
public startCallback ( CacheKey $k, callable $c, array $cparams = [], integer $lifetime = null )
$k CacheKey
$c callable A callable. Whatever it prints will be cached.
$cparams array parameters for the callback, optional
$lifetime integer
 protected function _callback(CacheAbstract $cache)
 {
     $base = 'callback';
     $key1 = new CacheKey($base, 1);
     $cache->clean($key1);
     $this->assertEquals(CALLBACKVALUE, $cache->startCallback($key1, 'callbackTester'));
     try {
         $data = $cache->getData($key1);
         $this->assertEquals(CALLBACKVALUE, $data->stringify($cache));
     } catch (Cachearium\Exceptions\NotCachedException $e) {
         $this->fail();
     }
 }