Serialize a resultset?

View: New views
2 Messages — Rating Filter:   Alert me  

Serialize a resultset?

by Octavian Râşniţă :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Can a DBIC resultset be serialized in order to be stored in the cache?

With other words, is it possible to do:

my $cache = $c->cache;
my $feeds = $cache->get($pg);

unless (defined $feeds) {
$feeds = $c->model("DB::Feed")->get_feeds($pg);
$cache->set($pg, $feeds, 10);
}

Thank you.

--
Octavian


_______________________________________________
List: Catalyst@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: Serialize a resultset?

by Tomas Doran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 27 Oct 2009, at 07:21, Octavian Râşniţă wrote:

> Hi,
>
> Can a DBIC resultset be serialized in order to be stored in the cache?
>

This is a dbix::class question, not a Catalyst question.

But, nonetheless, why not just use  
DBIx::Class::ResultClass::HashRefInflator

Cheers
t0m


_______________________________________________
List: Catalyst@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/