package PubNub::PubSub;
use strict;
use warnings;
use v5.10;
use Carp;
use Mojo::JSON qw/encode_json/;
use Mojo::UserAgent;
use Mojo::Util qw/url_escape/;
use PubNub::PubSub::Message;
our $VERSION
";
return map {
my $json = $_->json;
my $uri = Mojo::URL->new($self->{web_host} . qq~/publish/$pub_key/$sub_key/0/$channel/0/~ . url_escape($json));
$uri->query($_->query
my $json = $tx->res->json;
my @cb_args = $params{raw_msg} ? ($json) : (@{$json->[0]});
my $rtn = $callback ? $callback->(@cb_args) : 1;
return unless $rtn;
$timetoken = $json->[1];
package PubNub::PubSub::Message;
use Carp;
use Mojo::JSON qw(encode_json decode_json);
use strict;
use warnings;
our $VERSION = '1.0.1'; ## VERSION
=head1 NAME
PubNub::PubSub::Message - Messag
atastructure;
my $message = PubNub::PubSub::Message->new(payload=> $datastructure);
my $json = $message->json;
my $payload = $message->payload;
my $queryhash = $message->query_params;
=head1 METH
ortt, meta, ear,
and seqn, supported per the PubNub API. These other arguments are converted
to JSON in the query_params method below.
If a simple scalar is passed (not a reference), it is assumed