Skip to content

Instantly share code, notes, and snippets.

@und3f
Created August 1, 2011 11:49
Show Gist options
  • Save und3f/1117999 to your computer and use it in GitHub Desktop.
Save und3f/1117999 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use Mojolicious::Lite;
use MojoX::Redis;
use Data::Dumper;
get '/' => sub {
my $self = shift;
my $redis = MojoX::Redis->new(server => '127.0.0.1:6379');
$redis = $redis->ioloop(Mojo::IOLoop->new);
my $data_out;
$redis->hmget(
'111', 'test1', 'test2',
'test3' => sub {
my ($redis, $res) = @_;
$data_out = $res;
$redis->quit;
$redis->stop;
}
);
$redis->start;
$self->render_text(Dumper $data_out);
};
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment