Skip to content

Instantly share code, notes, and snippets.

Created October 29, 2015 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ab02a2df3f770543bac5 to your computer and use it in GitHub Desktop.
Save anonymous/ab02a2df3f770543bac5 to your computer and use it in GitHub Desktop.
$tx->on(drain =>
sub {
print "JSON Data Sent.\n";
Mojo::IOLoop->stop;
});
foreach my $i (1..10) {
my $ts = POSIX::strftime("%Y%m%d%H%M%S", localtime);
foreach my $se (@SEList) {
my $json = '{"test_id":"10","a_id":"20","se_id":"30","timestamp":"20151029194500","payload":{"kpi1":"23.45"}}';
$tx->send($json);
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
sleep(5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment