On 12/21/2010 09:26 AM, Tommy Butler wrote: > So where does memcached come into play with > DBIx::Class::Cursor::Cached? Without more source diving, dare I say > that it does not?
Doing more source investigation it looks like
DBIx::Class::Cursor::Cached just pulls in a very generic caching object
right from its constructor method. It also seems from the source code
that the cache object is expected to have a get and a set method, which
Cache::Memcached *does* provide. Cool. So based on the documentation
it looks like I could change this...
$schema->default_resultset_attributes({
cache_object => Cache::FileCache->new({ namespace => 'SchemaClass' }),
});
...to this...
$schema->default_resultset_attributes({
cache_object => Cache::Memcached->new({ namespace => 'Foo...' }),
});
...and have no problem. This remains to be tested, but I expect it
could work. Now the next step would be figuring out how to go about
finding the correct context for the catalyst equivalent to
"$schema->default_resultset_attributes(...)". Guess I'll work on that ;~)
A better explanation of all this would have been nice to see in the
advent calendar article.
--
Tommy
signature.asc
Description: OpenPGP digital signature
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
