Query: catalyst::component::instancepercontext
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Catalyst::Component::InstancePerContext(3pm) User Contributed Perl Documentation Catalyst::Component::InstancePerContext(3pm)NAMECatalyst::Component::InstancePerContext - Return a new instance a component on each requestSYNOPSYSpackage MyComponent; use Moose; with 'Catalyst::Component::InstancePerContext'; sub build_per_context_instance{ my ($self, $c) = @_; # ... do your thing here return SomeModule->new(%args); }REQUIRED METHODSYour consuming class must implement the following method. build_per_context_instance The value returned by this call is what you will recieve when you call $c->component('YourComponent').PROVIDED METHODSThis role will add the following method to your consuming class. ACCEPT_CONTEXT If the context is not blessed, it will simple pass through the value of "build_per_context_instance". If context is blessed it will look in the "stash" for an instance of the requested component and return that or, if the value is not found, the value returned by "build_per_context_instance" will be stored and return. The idea behind this behavior is that a component can be built on a per-request basis, as the name of this module implies.SEE ALSOMoose, Moose::Role, Catalyst::ComponentAUTHORGuillermo Roditi (groditi) <groditi@cpan.org>LICENSEYou may distribute this code under the same terms as Perl itself. perl v5.14.2 2007-06-07 Catalyst::Component::InstancePerContext(3pm)
Similar Topics in the Unix Linux Community |
---|
IBM Tooling for Service Component Architecture |
Subsystem Component Failure |
How much space I am consuming? |
Microline Component ToolKit equivalent |