line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::App::EventSource::Connection; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
24853
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
133
|
|
4
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
457
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
4
|
|
|
4
|
1
|
2861
|
my $class = shift; |
8
|
4
|
|
|
|
|
12
|
my (%params) = @_; |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
|
|
9
|
my $self = {}; |
11
|
4
|
|
|
|
|
13
|
bless $self, $class; |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
|
|
16
|
$self->{push_cb} = $params{push_cb}; |
14
|
4
|
|
|
|
|
14
|
$self->{close_cb} = $params{close_cb}; |
15
|
|
|
|
|
|
|
|
16
|
4
|
|
|
|
|
14
|
return $self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub push { |
20
|
3
|
|
|
3
|
1
|
17
|
my $self = shift; |
21
|
|
|
|
|
|
|
|
22
|
3
|
|
|
|
|
11
|
$self->{push_cb}->(@_); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub close { |
26
|
3
|
|
|
3
|
1
|
26
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
3
|
|
|
|
|
10
|
$self->{close_cb}->(); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
__END__ |