Skip Menu |

This queue is for tickets about the Catalyst-Plugin-Cache CPAN distribution.

Report information
The Basics
Id: 28584
Status: resolved
Priority: 0/
Queue: Catalyst-Plugin-Cache

People
Owner: NUFFIN [...] cpan.org
Requestors: hl [...] muenchen-mail.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Setting up Cache::FastMmap as backend fails
Date: Tue, 31 Jul 2007 14:53:46 +0200
To: bug-Catalyst-Plugin-Cache [...] rt.cpan.org
From: Herbert Leitz <hl [...] muenchen-mail.de>
Hi, this is not a really a bug, but an interoperability issue. I'm using Catalyst::Plugin::Cache-0.03 and Cache::FastMmap-1.16. If I specify Cache::FastMmap as a backend in myapp.yml: ... cache: backends: test: class: Cache::FastMmap expire_time: 1d share_file: /tmp/test_cache ... then setup_cache_backend_by_class() calls Cache::FastMmap->new(\%config) but it really needs an even-sized list Cache::FastMmap->new(%config) So maybe some provisions should be made for the different calling conventions of the backends. Herbert Leitz
It's fixed in trunk, but I'm hesitent. Here's what I asked my army of Catalyst users to do: 17:30 <@nothingmuch> i need everyone to test C::P::Cache in trunk 17:31 <@nothingmuch> the change is when a backend is configured using class 17:31 <@nothingmuch> it'll first try to construct that class as $class->ew(%args); and then $class->new(\%args); 17:31 <@nothingmuch> it used to only do $class->new(%args); 17:31 <@nothingmuch> but typically passing \%args to something that then does my %args = @args will cause a warning, not an error 17:32 <@nothingmuch> wheras trying to deref the first hash key as a hash ref is an error, not a warning 17:32 <@nothingmuch> this is yucky 17:32 <@nothingmuch> but i think it's ever so slightly less yucky than keeping a list of which Cache backend like this and which likes that 17:32 <@nothingmuch> (FYI most of them accept both, some only \%argts, and Cache::FastMmap only %args); 17:32 <@nothingmuch> http://rt.cpan.org/Ticket/Display.html?id=28584 17:33 <@nothingmuch> another idea is to add a 'pass_ref' option 17:33 <@nothingmuch> so class => "Cache::FastMmap", pass_ref => 1, 17:33 <@nothingmuch> this risks no back compat problems at all 17:33 <@nothingmuch> but usability wise it's the last nice 17:33 <@nothingmuch> anyway, please report your findings minions! Your thoughts on the subject are more than welcome. Cheers,
For now a work around you could put the object there directly: $c->config->{cache}{backend} = Cache::FastMmap->new... Unfortunately this will not work with YAML
Subject: Re: [rt.cpan.org #28584] Setting up Cache::FastMmap as backend fails
Date: Tue, 31 Jul 2007 19:30:43 +0200
To: bug-Catalyst-Plugin-Cache [...] rt.cpan.org
From: Herbert Leitz <hl [...] muenchen-mail.de>
Am Dienstag, 31. Juli 2007 16:34 schrieb יובל קוג'מן via RT: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=28584 > > > It's fixed in trunk, but I'm hesitent. > > Here's what I asked my army of Catalyst users to do: >
... Show quoted text
> > Your thoughts on the subject are more than welcome. > > Cheers,
Thanks for your fast response. Yes, this is a yucky problem. My suggestion is: use all three options. 1. Keep a list of well known modules. There aren't too many and their APIs will not change. 2. If a module is unknown, check 'pass_ref' 3. If pass_ref doesn't exist, try $class->new(%args) and then $class->new(\%args) This way, C::P::Cache will do the right thing and will work with as many different Modules as possible. Regards Herbert Leitz
Is this still an issue? I'm not up to date
Subject: Re: [rt.cpan.org #28584] Setting up Cache::FastMmap as backend fails
Date: Sun, 22 Jun 2008 15:48:54 +0200
To: bug-Catalyst-Plugin-Cache [...] rt.cpan.org
From: Herbert Leitz <Herbert.Leitz [...] t-online.de>
Am Samstag, 21. Juni 2008 19:52:20 schrieb יובל קוג'מן via RT: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=28584 > > > Is this still an issue? I'm not up to date
It has been fixed in Cache::FastMmap. Works fine now.