line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Promises6::Promise; |
2
|
30
|
|
|
30
|
|
17320
|
use Evo::Base -base; |
|
30
|
|
|
|
|
40
|
|
|
30
|
|
|
|
|
180
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
has [qw(builder)]; |
5
|
|
|
|
|
|
|
has deferred => sub { Carp::croak 'build me using deferred object' }; |
6
|
|
|
|
|
|
|
|
7
|
150
|
50
|
|
150
|
1
|
5467
|
sub then($self, @subs) { |
|
150
|
|
|
|
|
168
|
|
|
150
|
|
|
|
|
419
|
|
|
150
|
|
|
|
|
155
|
|
8
|
150
|
|
|
|
|
2813
|
my $d = $self->builder->deferred; |
9
|
150
|
|
|
|
|
4029
|
my $listener = $self->builder->listener(cbs => \@subs, deferred => $d); |
10
|
|
|
|
|
|
|
|
11
|
150
|
|
|
|
|
3954
|
$self->deferred->subscribe($listener); |
12
|
150
|
|
|
|
|
684
|
$d->promise; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
1; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# ABSTRACT: A promise. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
__END__ |