1 package APKPM::Bitstream;
3 use base qw(Gearman::Driver::Worker);
6 use Data::Dump qw(dump);
10 with 'APKPM::Gearman';
12 sub prefix { 'Bitstream_' }
15 my ( $self, $orig, $job_name ) = @_;
16 warn "# process_name $orig $job_name\n";
17 return "$orig ($job_name)";
20 sub poll : Job : Encode(e_json) {
21 my ( $self, $job, $workload ) = @_;
23 my $content = get 'http://172.18.0.38/bs_ip_lookup';
24 my $json = decode_json $content;
28 foreach my $cpe ( @{ $json->{bs_ip_lookup} } ) {
29 if ( $cpe->{username} =~ m/h1dsl-flat/ ) {
30 warn "SKIP: ",dump($cpe) if $ENV{DEBUG};
36 warn "# poll = ",dump( @users );