rewrote Request lifecycle
[catagits/Catalyst-Runtime.git] / lib / Catalyst / IOC / LifeCycle / Request.pm
CommitLineData
2402ef14 1package Catalyst::IOC::LifeCycle::Request;
2use Moose::Role;
3use namespace::autoclean;
2402ef14 4with 'Bread::Board::LifeCycle::Singleton';
5
1a6941f5 6around get => sub {
7 my $orig = shift;
8 my $self = shift;
9
10 my $ctx = $self->param('ctx');
11 my $stash_key = "__Catalyst_IOC_LifeCycle_Request_" . $self->name;
12 return $ctx->stash->{$stash_key} ||= $self->$orig(@_);
13};
14
2402ef14 151;
64e06b7d 16
17__END__
18
19=pod
20
21=head1 NAME
22
23Catalyst::IOC::LifeCycle::Request - Components that last for one request
24
25=head1 SYNOPSIS
26
27=head1 DESCRIPTION
28
29=head1 METHODS
30
31=head1 AUTHORS
32
33Catalyst Contributors, see Catalyst.pm
34
35=head1 COPYRIGHT
36
37This library is free software. You can redistribute it and/or modify it under
38the same terms as Perl itself.
39
40=cut