m::VERSION = '0.01';
}
use Moose;
use IO::Handle qw(autoflush);
use IO::File;
use JSON::XS qw(decode_json encode_json);
use Log::Log4perl;
use IO::Storm::Tuple;
# ABSTRACT: Perl support for Twitter'
($self) = @_;
return decode_json($self->read_string_message);
}
sub send_message_to_parent {
my ($self, $href) = @_;
$self->send_to_parent(encode_json($href));
}
sub send_to_parent
Read a message from the ShellBolt and decode it from JSON.
=head2 send_message_to_parent
Sent a message to the ShellBolt, encoding it as JSON.
=head2 send_to_parent
Send a message to the ShellBo
warnings;
use v5.10;
use IO::Handle qw(autoflush);
use IO::File;
use Log::Log4perl qw(:easy);
use JSON::XS;
use Data::Dumper;
use IO::Storm::Tuple;
# Setup Moo for object-oriented niceties
use Moo;
u
'max_blank_msgs' => (
is => 'rw',
default => 500
);
has '_json' => (
is => 'rw',
default => sub { JSON::XS->new->allow_blessed->convert_blessed }
);
has '_topology_name' =>
}
}
chomp($line);
push( @messages, $line );
}
return $self->_json->decode( join( "\n", @messages ) );
}
sub read_task_ids {
my $self = shift;
if ( scalar
a spout tuple message.
:param tup: the tuple to send to Storm. Should contain only
JSON-serializable data.
:type tup: list
:param tup_id: the ID for the tuple. Leave this blank for an