Group
Extension

Matches 2

IO-Multiplex-Intermediary ( J/JA/JASONMAY/IO-Multiplex-Intermediary-0.06.tar.gz, JASONMAY, 2011; MetaCPAN )
IO-Multiplex-Intermediary/lib/IO/Multiplex/Intermediary.pm ( view source; MetaCPAN )
/bin/env perl
package IO::Multiplex::Intermediary;

our $VERSION = "0.06";

use MooseX::POE;

use JSON;
use List::MoreUtils qw(any);
use Scalar::Util qw(reftype);

use POE qw(
    Wheel::SocketFactory
   my $json = eval { from_json($input) };

    {
        if ($@ || !$json) {
            warn "JSON error: $@";
        }
        elsif (!exists $json->{param}) {
            warn "Invalid JSON struct
          last unless $json->{data}->{id};
            last unless reftype($self->rw_set);
            last unless $self->rw_set->{ $json->{data}->{id} };

            if ($json->{param} eq 'output') 
IO-Multiplex-Intermediary ( J/JA/JASONMAY/IO-Multiplex-Intermediary-0.06.tar.gz, JASONMAY, 2011; MetaCPAN )
IO-Multiplex-Intermediary/lib/IO/Multiplex/Intermediary/Client.pm ( view source; MetaCPAN )

use namespace::autoclean;

use IO::Socket;
use IO::Select;
use Time::HiRes qw(gettimeofday);
use JSON;

local $| = 1;

has socket => (
    is         => 'rw',
    isa        => 'IO::Socket::INET',
  
 @inputs = grep { $_ } split /\e/m, $input;
    for (@inputs) {
        my $output = $self->parse_json($_);
        $self->socket->send("$output\n\e");
    }
};

sub build_response {
    my $self     
ift;
    my $data   = shift;

    return to_json({param => 'null'});
}

sub input_hook {
    my $self   = shift;
    my $data   = shift;

    return to_json(
        {
            param => 'output',
 

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.