package Plack::Session::Store::RedisFast::Encoder::JSON;
use strict;
use warnings;
use 5.008_005;
use JSON ();
sub new {
return JSON->new->utf8->allow_nonref;
}
1;
__END__
=pod
=encoding u
tf-8
=head1 NAME
Plack::Session::Store::RedisFast::JSON - L<JSON> adapter for Redis session store.
=head1 DESCRIPTION
L<JSON>-based implementation of L<Plack::Session::Store::RedisFast/inflate>
an
eflate>.
=head1 SYNOPSIS
use Plack::Session::Store::RedisFast::JSON;
my $encoder = Plack::Session::Store::RedisFast::JSON->new;
my $bytes = $encoder->encode( $hashref );
my $hashr
ackage Plack::Session::Store::RedisFast::Encoder::MojoJSON;
use strict;
use warnings;
use 5.008_005;
use Mojo::JSON qw( decode_json encode_json );
sub new {
my ($class) = @_;
bless {}, $c
e_json($thing);
}
sub decode {
my ( $self, $bytes ) = @_;
decode_json($bytes);
}
1;
__END__
=pod
=encoding utf-8
=head1 NAME
Plack::Session::Store::RedisFast::MojoJSON - L<Mojo::JSON>
ojo::JSON>-based implementation of L<Plack::Session::Store::RedisFast/inflate>
and L<Plack::Session::Store::RedisFast/deflate>.
=head1 SYNOPSIS
use Plack::Session::Store::RedisFast::MojoJSON;
package Plack::Session::Store::RedisFast::Encoder::JSONXS;
use strict;
use warnings;
use 5.008_005;
use JSON::XS ();
sub new {
return JSON::XS->new->utf8->allow_nonref;
}
1;
__END__
=pod
=
oding utf-8
=head1 NAME
Plack::Session::Store::RedisFast::JSONXS - L<JSON::XS> adapter for Redis session store.
=head1 DESCRIPTION
L<JSON::XS>-based implementation of L<Plack::Session::Store::Redi
flate>.
=head1 SYNOPSIS
use Plack::Session::Store::RedisFast::JSONXS;
my $encoder = Plack::Session::Store::RedisFast::JSONXS->new;
my $bytes = $encoder->encode( $hashref );
my $ha
encoding utf-8
=head1 NAME
Plack::Session::Store::RedisFast::JSON - L<JSON> adapter for Redis session store.
=head1 DESCRIPTION
L<JSON>-based implementation of L<Plack::Session::Store::RedisFast/i
eflate>.
=head1 SYNOPSIS
use Plack::Session::Store::RedisFast::JSON;
my $encoder = Plack::Session::Store::RedisFast::JSON->new;
my $bytes = $encoder->encode( $hashref );
my $hashr
coder->decode( $bytes );
=head1 DESCRIPTION
Used by default when L<JSON::XS> and L<Mojo::JSON> are not available.
=head1 METHODS
=head2 new
Plack::Session::Store::RedisFast::JSON->new;
=cut
t::Encoder::JSONXS;
$instance = Plack::Session::Store::RedisFast::Encoder::JSONXS->new;
1;
} or do {
require Plack::Session::Store::RedisFast::Encoder::MojoJSON;
$i
ast::Encoder::MojoJSON->new;
}
or do {
require Plack::Session::Store::RedisFast::Encoder::JSON;
$instance = Plack::Session::Store::RedisFast::Encoder::JSON->new;
};
en through L</redis> param.
Default implementation of serializer handle is L<JSON::XS>; otherwise L<Mojo::JSON> or L<JSON>.
May be overriden through L</inflate> and L</deflate> param.
=head1 SYNOPS