Message-Passing-Output-PocketIO

 view release on metacpan or  search on metacpan

lib/Message/Passing/Output/PocketIO.pm  view on Meta::CPAN

=head1 NAME

Message::Passing::Output::PocketIO - Output passing message as PocketIO Server

=head1 DESCRIPTION

Run a webserver using PocketIO, then we can see the passing messages by browser. Even notify by chrome desktop notification api.

=head1 SYNOPSIS

    $ message-passing --input STDIN --output PocketIO
    {"foo" : "bar"}
    $ open http://localhost:8080/

=head1 METHODS
 
=head2 consume ($msg)
 
=head1 SEE ALSO
 
=over
 
=item L<Message::Passing>
 
=item L<http://logstash.net>
 
=item L<http://socket.io>

=item L<PocketIO>

=back
 
=head1 AUTHOR

chenryn, E<lt>rao.chenlin@gmail.com<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2012 by chenryn

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.14.2 or,
at your option, any later version of Perl 5 you may have available.

=cut

package Message::Passing::Output::PocketIO;
use strict;
use warnings;
use Moo;
use MooX::Types::MooseLike::Base qw/ Str ArrayRef /;
use Scalar::Util qw/ weaken /;
use namespace::clean -except => 'meta';
use JSON;
use AnyMQ;
use AnyEvent;
use PocketIO;
use Twiggy::Server;
use Plack::Builder;
use Data::Section::Simple qw/ get_data_section /;
use Data::Dumper;

our $VERSION = '0.01';
 
with qw/ Message::Passing::Role::Output /;
 
has 'hostname' => (



( run in 1.339 second using v1.01-cache-2.11-cpan-df04353d9ac )