The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Catalyst::Plugin::Session::Store::Redis::Fast - Catalyst session store Redis Fast Plugin
works with redis 2.0.0 and above
Redis::Fast is 50% faster than Redis.pm

VERSION

Version 1.000

SYNOPSIS

   use Catalyst qw/
       Session
       Session::Store::Redis::Fast
       Session::State::Foo
   /;
    
   MyApp->config->{Plugin::Session} = {
       server       => '127.0.0.1:6379',   # Defaults to $ENV{REDIS_SERVER} or 127.0.0.1:6379
       sock         => '/path/to/socket',  #(optional) use unix socket
       reconnect    => 60,                 #(optional) Enable auto-reconnect
       every        => 500_000,            #(optional) Try to reconnect every 500ms up to 60 seconds until success
       encoding     => undef,              #(optional) Disable the automatic utf8 encoding => much more performance
       password     => 'TEST',             #(optional) default undef
       select_db    => 4,                  #(optional) will use the redis db default 0
   };

   # ... in an action:
   $c->session->{foo} = 'bar'; # will be saved

method

server (optional) either server or sock

# Defaults to $ENV{REDIS_SERVER} or 127.0.0.1:6379
MyApp->config->{Plugin::Session} = {
    server => '127.0.0.1:6379',
}

sock (optional)

# use unix socket
 MyApp->config->{Plugin::Session} = {
     sock    => '/path/to/socket',
 }

reconnect & every (optional)

## Enable auto-reconnect
## Try to reconnect every 500ms up to 60 seconds until success
## Die if you can't after that

MyApp->config->{Plugin::Session} = {
    server    => '127.0.0.1:6379',
    reconnect => 60,
    every     => 500_000,
}

name (optional)

 ## Set the connection name (requires Redis 2.6.9)

MyApp->config->{Plugin::Session} = {
    server => '127.0.0.1:6379',
    name    => 'TEST',
}

encoding (optional)

## Disable the automatic utf8 encoding => much more performance
## !!!! This will be the default after redis version 2.000

MyApp->config->{Plugin::Session} = {
    server => '127.0.0.1:6379',
    enci    => 'TEST',
}

password (optional)

## Sets the connection password

MyApp->config->{Plugin::Session} = {
    server      => '127.0.0.1:6379',
     encoding   => undef
}

select_db (optional)

## Selects db to be used for connection

MyApp->config->{Plugin::Session} = {
    server      => '127.0.0.1:6379',
    select_db   => 3
}

refer Redis::Fast for more connection method support

no_auto_connect_on_new => 1,
server => '127.0.0.1:6379',
write_timeout => 0.2,
read_timeout => 0.2,
cnx_timeout => 0.2,

AUTHOR

Sushrut Pajai, <spajai at cpan.org>

BUGS

Please report any bugs or feature requests to

bug-catalyst-plugin-session-store-redis-fast at rt.cpan.org, or through

the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-Plugin-Session-Store-Redis-Fast.

I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Catalyst::Plugin::Session::Store::Redis::Fast

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is copyright (c) 2021 by Sushrut Pajai

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language itself.