[Catalyst] auto re-load of application yaml config file?

2008-07-22 Thread Marc Sebastian Pelzer

Hello,

I'm running a Catalyst application under mod_perl and wonder if there  
is a Plugin available that detects changes on the main  
application .yml config file and does a automatic re-load if needed?  
It not - what would be the most elegant (and less I/O intensive) way  
of doing this? Would it be enough to do a


__PACKAGE__-config( 'Plugin::ConfigLoader' = { file =  
'my_config.yml' } );
in my Root controller when I detect a change? Also, is there a way to  
store the state (maybe the mtime of the config file) in memory without  
being lost between requests? Or do I need to store the mtime in a  
database/memcache/tempfile (which would be expensive)?

Many thanks in advance for any hint :)


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


[Catalyst] Private Chained Actions?

2008-06-20 Thread Marc Sebastian Pelzer

Hello,

I'd like to forward and/or detach to private actions which should be  
chained together, like:


sub hello_setup : Privat Chained {
  my ($self, $c) = @_

  $c-stash-{setup} = 'done';
}

sub hello : Private Chained('hello_setup') {
  my ($self, $c) = @_

  $c-res-body('hello! setup is ' . $c-stash-{setup});
}

sub index : Path : Args(0) {
  my ($self, $c) = @_

  $c-detach('hello');
}

This does actually not work. Only hello() is being called.

Has anyone an idea, how to make this work? Or is this just not  
supported (yet)?


Thanks, Marc :)

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


Re: [Catalyst] Re: Private Chained Actions?

2008-06-20 Thread Marc Sebastian Pelzer



You need a screwdriver, not a hammer.


   sub hello_setup : Private {
 my ($self, $c) = @_
 $c-stash-{setup} = 'done';
   }

   sub hello : Private {
 my ($self, $c) = @_
 $c-forward('hello_setup'); # -
 $c-res-body('hello! setup is ' . $c-stash-{setup});
   }

   sub index : Path : Args(0) {
 my ($self, $c) = @_
 $c-detach('hello');
   }



thanks for the hint. Thats what I'm doing right now. I thought that  
there may be a more elegant way of doing this. Especially for a longer/ 
more complex chained setup :) Also, doing it this way it does not look  
not too nice in the dispatcher path in the debug logfile - hello()  
comes before hello_setup() :-|


Thanks! Marc


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