| 1 | package POE::Component::Server::SimpleHTTP::State; | ||||||||||
| 2 | 9 | $POE::Component::Server::SimpleHTTP::State::VERSION = '2.30'; | |||||||||
| 3 | 9 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 9 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 9 | ▶ | use POE::Wheel::ReadWrite; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 9 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 9 | has 'wheel' => ( | |||||||||
| 10 | is => 'ro', | ||||||||||
| 11 | isa => 'POE::Wheel::ReadWrite', | ||||||||||
| 12 | clearer => 'clear_wheel', | ||||||||||
| 13 | predicate => 'has_wheel', | ||||||||||
| 14 | required => 1, | ||||||||||
| 15 | ); | ||||||||||
| 16 | |||||||||||
| 17 | 9 | has 'response' => ( | |||||||||
| 18 | is => 'ro', | ||||||||||
| 19 | isa => 'POE::Component::Server::SimpleHTTP::Response', | ||||||||||
| 20 | writer => 'set_response', | ||||||||||
| 21 | clearer => 'clear_response', | ||||||||||
| 22 | ); | ||||||||||
| 23 | |||||||||||
| 24 | 9 | has 'request' => ( | |||||||||
| 25 | is => 'ro', | ||||||||||
| 26 | isa => 'HTTP::Request', | ||||||||||
| 27 | writer => 'set_request', | ||||||||||
| 28 | clearer => 'clear_request', | ||||||||||
| 29 | ); | ||||||||||
| 30 | |||||||||||
| 31 | 9 | has 'connection' => ( | |||||||||
| 32 | is => 'ro', | ||||||||||
| 33 | isa => 'POE::Component::Server::SimpleHTTP::Connection', | ||||||||||
| 34 | writer => 'set_connection', | ||||||||||
| 35 | clearer => 'clear_connection', | ||||||||||
| 36 | init_arg => undef, | ||||||||||
| 37 | ); | ||||||||||
| 38 | |||||||||||
| 39 | has 'done' => ( | ||||||||||
| 40 | is => 'ro', | ||||||||||
| 41 | isa => 'Bool', | ||||||||||
| 42 | init_arg => undef, | ||||||||||
| 43 | 10 | ▶ | default => sub { 0 }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 44 | 9 | writer => 'set_done', | |||||||||
| 45 | ); | ||||||||||
| 46 | |||||||||||
| 47 | has 'streaming' => ( | ||||||||||
| 48 | is => 'ro', | ||||||||||
| 49 | isa => 'Bool', | ||||||||||
| 50 | init_arg => undef, | ||||||||||
| 51 | 10 | ▶ | default => sub { 0 }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 52 | 9 | writer => 'set_streaming', | |||||||||
| 53 | ); | ||||||||||
| 54 | |||||||||||
| 55 | 6 | ▶ | sub reset { | ||||||||
|
Subroutine
reset: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 56 | 6 | my $self = shift; | |||||||||
| 57 | 6 | $self->clear_response; | |||||||||
| 58 | 6 | $self->clear_request; | |||||||||
| 59 | 6 | $self->set_streaming(0); | |||||||||
| 60 | 6 | $self->set_done(0); | |||||||||
| 61 | 6 | ▶ | $self->wheel->set_output_filter( $self->wheel->get_input_filter ) if $self->has_wheel; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 62 | 6 | return 1; | |||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | 10 | ▶ | sub close_wheel { | ||||||||
|
Subroutine
close_wheel: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 66 | 10 | my $self = shift; | |||||||||
| 67 | 10 | ▶ | return unless $self->has_wheel; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 68 | 10 | $self->wheel->shutdown_input; | |||||||||
| 69 | 10 | $self->wheel->shutdown_output; | |||||||||
| 70 | 10 | $self->clear_wheel; | |||||||||
| 71 | 10 | return 1; | |||||||||
| 72 | } | ||||||||||
| 73 | |||||||||||
| 74 | 26 | ▶ | sub wheel_alive { | ||||||||
|
Subroutine
wheel_alive: called CC=4 SCAR=14.6
Pod
undocumented
| |||||||||||
| 75 | 26 | my $self = shift; | |||||||||
| 76 | 26 | ▶ | return unless $self->has_wheel; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 77 | 26 | ▶ | return unless defined $self->wheel; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 78 | 26 | ▶ | return unless $self->wheel->get_input_handle(); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 79 | 26 | return 1; | |||||||||
| 80 | } | ||||||||||
| 81 | |||||||||||
| 82 | 9 | ▶ | no Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 83 | |||||||||||
| 84 | 9 | __PACKAGE__->meta->make_immutable(); | |||||||||
| 85 | |||||||||||
| 86 | 9 | 'This monkey has gone to heaven'; | |||||||||
| 87 | |||||||||||
| 88 | __END__ | ||||||||||