Skip to content

Instantly share code, notes, and snippets.

@und3f
Created August 1, 2011 11:41
Show Gist options
  • Save und3f/1117988 to your computer and use it in GitHub Desktop.
Save und3f/1117988 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use MojoX::Redis;
my $redis = MojoX::Redis->new(server => '127.0.0.1:6379');
$redis = $redis->ioloop(Mojo::IOLoop->new);
$redis->hmset(
'111',
test1 => 'test1',
test2 => 'test2',
test3 => 'test3'
);
my ($data_out1, $data_out2, $data_out3);
$redis->hmget(
'111', 'test1', 'test2',
'test3' => sub {
my ($redis, $res) = @_;
print Dumper $res;
}
);
$redis->hmset('111', 'test1' => 'foo1', 'test2' => 'foo2', 'test3' => 'foo3');
$redis->hmget(
'111', 'test1', 'test2',
'test3' => sub {
my ($redis, $res) = @_;
print Dumper $res;
$redis->stop;
}
);
$redis->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment