line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::Bitcoin::Feed::Site::BitStamp::Socket; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
5
|
1
|
|
|
1
|
|
390
|
use parent qw(Finance::Bitcoin::Feed::Pusher); |
|
1
|
|
|
|
|
207
|
|
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
65
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
187
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
1
|
|
|
1
|
|
17
|
my $self = shift->SUPER::new(channels => [qw/live_trades/]); |
10
|
1
|
|
|
|
|
3
|
$self->{owner} = shift; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#weaken it to prevent from crossing reference |
13
|
1
|
|
|
|
|
4
|
weaken($self->{owner}); |
14
|
1
|
|
|
|
|
2
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub trade { |
18
|
1
|
|
|
1
|
0
|
1433
|
my $self = shift; |
19
|
1
|
|
|
|
|
2
|
my $data = shift; |
20
|
1
|
|
|
|
|
11
|
$self->{owner}->emit('data_out', 0, "BTCUSD", $data->{price}); |
21
|
1
|
|
|
|
|
7
|
return; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub go { |
25
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
26
|
0
|
|
|
|
|
|
$self->setup; |
27
|
0
|
|
|
|
|
|
$self->handle; |
28
|
0
|
|
|
|
|
|
return; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |