Group
Extension

Matches 11

POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/testbin/client.pl ( view source; MetaCPAN )
#!/usr/bin/perl

use strict;
use warnings;
use FindBin;
use Data::Dumper;
use JSON::Any qw(XS);
use lib "$FindBin::Bin/../lib";

use POE qw(Component::Client::Bayeux);

POE::Component::Client::Bayeux-

                user => "POE",
                chat => "POE has joined",
                join => JSON::XS::true,
            });
            $kernel->delay('publish', 5);
        },
        publish =
POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/lib/POE/Component/Server/Bayeux/Message/Service.pm ( view source; MetaCPAN )

        }
    }

    if ($self->is_error) {
        push @responses, {
            successful => JSON::XS::false,
            error => $self->is_error,
        };
    }

    foreach my $response (@re
POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/lib/POE/Component/Server/Bayeux.pm ( view source; MetaCPAN )
raft1) from the Dojo Foundation.
Also called cometd, Bayeux is a low-latency routing protocol for JSON encoded
events between clients and servers in a publish-subscribe model.

This is the server impl
 JSON::XS;
            my $json = JSON::XS->new();
            $json->indent(1);
            $json->ascii(1);
            $json->space_after(1);
            $self{dumper} = sub {
                $json
      $response->code(RC_SERVICE_UNAVAILABLE);
        $response->header( 'Content-Type' => "text/json; charset=utf-8" );
        $response->content( '{ "error": "Too many connections from your IP", "
POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/lib/POE/Component/Client/Bayeux.pm ( view source; MetaCPAN )
         user => "POE",
                    chat => "POE has joined",
                    join => JSON::XS::true,
                });
            },
            events => sub {
                my ($ke
raft1) from the Dojo Foundation.
Also called cometd, Bayeux is a low-latency routing protocol for JSON encoded
events between clients and servers in a publish-subscribe model.

This is the client impl
::Client::HTTP Component::Client::Bayeux::Transport);
use Params::Validate;
use Data::Dumper;
use JSON::Any;
use Data::UUID;
use HTTP::Request::Common;
use Log::Log4perl qw(get_logger :levels);
use Lo
POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/lib/POE/Component/Server/Bayeux/Request.pm ( view source; MetaCPAN )
uest and HTTP::Response object.  This class is responsible for parsing the request content into a JSON object, creating one or more L<POE::Component::Server::Bayeux::Message> objects that represent th

use HTTP::Status; # for RC_OK
use HTTP::Request::Common;
use CGI::Simple::Util qw(unescape);
use JSON::Any qw(XS);
use Data::UUID;
use Params::Validate;

use POE qw(Component::Server::Bayeux::Message
quest
    http_response
    json_response
    messages
    responses
    heap
    delay
    post_handle
    json_comment_filtered
));

## Class Globals ###

my $json = JSON::Any->new();
my $uuid = Dat
POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/lib/POE/Component/Client/Bayeux/Utilities.pm ( view source; MetaCPAN )
ies;

use strict;
use warnings;
use JSON::Any;
use base qw(Exporter);

our @EXPORT_OK = qw(decode_json_response);

my $json_any = JSON::Any->new();

sub decode_json_response {
    my ($response) = @_;
onse->content_type eq 'text/json-comment-filtered') {
        $content =~ s{^\s* /\* \s* (.+?) \s* \*/ \s*$}{$1}x;
    }

    my $object;
    eval {
        $object = $json_any->decode($content);
    
};
    if ($@) {
        die "Failed to JSON decode data (error $@).  Content:\n" . $content;
    }

    return $object;
}

1;
POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/lib/POE/Component/Server/Bayeux/Client.pm ( view source; MetaCPAN )
comment filtered JSON, pass this along to the
    # request which will be encapsulating the results.
    if ($self->flags->{'json-comment-filtered'}) {
        $message->request->json_comment_filtered
POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/lib/POE/Component/Server/Bayeux/Message/Meta.pm ( view source; MetaCPAN )
:Server::Bayeux::Message> to implement the /meta/* channels.

=cut

use strict;
use warnings;
use JSON::Any qw(XS);
use Switch;
use Params::Validate qw(:types);
use base qw(POE::Component::Server::Bay
      if ($self->is_error) {
                push @responses, {
                    successful => JSON::XS::false,
                    error => $self->is_error,
                };
                last
portedConnectionTypes => $supported_connection_types,
                successful               => JSON::XS::true,
                clientId                 => $client->id,
                advice       
POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/lib/POE/Component/Server/Bayeux/Message/Publish.pm ( view source; MetaCPAN )
lish(), with a response given back to the requesting client.

=cut

use strict;
use warnings;
use JSON::Any qw(XS);
use base qw(POE::Component::Server::Bayeux::Message);

__PACKAGE__->mk_data_accessor
->add_response({
        successful => JSON::XS::true,
    });
}

sub handle_error {
    my ($self, $error) = @_;

    my %response = (
        successful => JSON::XS::false,
        error => $error |
POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/lib/POE/Component/Client/Bayeux/Transport/LongPolling.pm ( view source; MetaCPAN )
POE;
use Data::Dumper;
use HTTP::Request;
use POE::Component::Client::Bayeux::Utilities qw(decode_json_response);

use base qw(POE::Component::Client::Bayeux::Transport);

sub extra_states {
    # ret
uest, encoding the messages into JSON
    my $request = HTTP::Request->new('POST', $pheap->{remote_url},
        [ 'content-type', 'text/json' ],
        $pheap->{json}->encode(\@messages),
    );

  
et->[0];

    my $meta = delete $heap->{_tunnelsOpen}{$request_tag};

    my $json;
    eval {
        $json = decode_json_response($response_object);
    };
    if ($@) {
        # Ignore errors if s
POE-Component-Server-Bayeux ( E/EW/EWATERS/POE-Component-Server-Bayeux-0.04.tar.gz, EWATERS, 2009; MetaCPAN )
POE-Component-Server-Bayeux/testbin/cli_client.pl ( view source; MetaCPAN )
#!/usr/bin/perl

use strict;
use warnings;
use Getopt::Long;
use FindBin;
use Data::Dumper;
use JSON::XS;
use lib "$FindBin::Bin/../lib";
use POE qw(
    Component::Client::Bayeux
    Component::Debug
        my $message;
        eval { $message = decode_json(join ' ', @message) };
        if ($@) {
            print STDERR "Failed to decode JSON data from input\n$@";
            return;
        }
      $message->{error} ? $message->{error} : '(no error)',
            $message->{data} ? encode_json($message->{data}) : '';
        return;
    }

    my $output = '';
    if (my $data = $message->

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