예제 #1
0
 /**
  * Handle the message to retrieve the cached content from the injected cache proxy
  * with a callback used as a fallback.
  * @param \Brickoo\Component\Messaging\Message $message
  * @return mixed the cached content otherwise null
  */
 public function handleRetrieveByCallbackMessage(Message $message)
 {
     if ($message instanceof RetrieveByCallbackMessage) {
         return $this->storageProxy->getByCallback($message->getIdentifier(), $message->getCallback(), $message->getCallbackArguments(), $message->getLifetime());
     }
     return null;
 }
예제 #2
0
 /**
  * @covers Brickoo\Component\Storage\StorageProxy::getByCallback
  * @expectedException \InvalidArgumentException
  */
 public function testGetByCallbackLifetimeThrowsInvalidArgumentException()
 {
     $storageProxy = new StorageProxy($this->getAdapterPoolIterator());
     $storageProxy->getByCallback("some_identifier", function () {
     }, [], "wrongType");
 }