Hi,
I'm writing a custom cache driver for DynamoDB and need to be able to overwrite the Cache::pull() method. I cannot use the default method (written below) for this driver as it calls the get and forget methods sequentially when, for DynamoDB, they can be done in one single call to the database. I need this functionality since reads/writes are provisioned so anything that takes up more impacts application performance.
public function pull($key, $default = null)
{
$value = $this->get($key, $default);
$this->forget($key);
return $value;
}
I've written most of my driver and all the other methods (get, forget, etc) work as expected, but this one doesn't. For testing, I made the function always return an arbitrary value so I could determine if my function or the default was running. I tried renaming it to puall and did a Cache::puall and it worked as expected, but I can't figure out how to overwrite the default Cache::pull.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community