Koha::Cache::Object - Tie-able class for caching objects
my $cache = Koha::Cache->new();
my $scalar = Koha::Cache->create_scalar(
{
'key' => 'whatever',
'timeout' => 2,
'constructor' => sub { return 'stuff'; },
}
);
my %hash = Koha::Cache->create_hash(
{
'key' => 'whateverelse',
'timeout' => 2,
'constructor' => sub { return { 'stuff' => 'nonsense' }; },
}
);
Do not use this class directly. It is tied to variables by Koha::Cache for transparent cache access. If you choose to ignore this warning, you should be aware that it is disturbingly polymorphic and supports both scalars and hashes, with arrays a potential future addition.
Koha::Cache, tie, perltie
Jared Camins-Esakov, <jcamins@cpbibliography.com>