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