Skip to content

Instantly share code, notes, and snippets.

@inish777
Created December 18, 2011 17:58
Show Gist options
  • Save inish777/1494051 to your computer and use it in GitHub Desktop.
Save inish777/1494051 to your computer and use it in GitHub Desktop.
=head1 How to use Dancer::Plugin::Redis
Dancer::Plugin::Redis is a plugin created to make an easy way to use Redis database in Dancer apps. In fact,
Dancer::Plugin::Redis is an abstraction from Redis plugin. It has only one function C<redis>, which returns a
database handle. See Redis module documentation for the list of controlling functions.
=head1 Introduction to Redis
Redis is key-value, networking, in-memory data store with optional durability. It is very useful technology because
it simple and fast. There is a good article about it in Wikipedia(http://en.wikipedia.org/wiki/Redis)
=head1 Synopsis
my $dbh = redis();
$dbh->get('hash_key');
=head1 Simple example
use Dancer;
use Dancer::Plugin::Redis;
# Calling the redis keyword will get you a connected Redis Database handle:
get '/widget/view/:id' => sub {
template 'display_widget', { widget => redis->get('time_applet'); };
};
dance;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment