X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FData.pm;h=e2ef0dcac0c12a3afbd8b98cc86c826137dafc53;hb=2264274695c1eb576c3c57dcce0bcc97a240a57a;hp=9f4cf952b1d7ebc64f6759e2708bb5198a185661;hpb=e5f2bda6c8984be0c49a3e058a165286791fef51;p=gruntmaster-page.git diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index 9f4cf95..e2ef0dc 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -9,6 +9,7 @@ use Redis; our $contest; my $redis = Redis->new; +my $pubsub = Redis->new; sub dynsub{ no strict 'refs'; @@ -19,6 +20,10 @@ BEGIN { for my $cmd (qw/multi exec smembers get hget hset sadd srem incr hmset hsetnx/) { dynsub uc $cmd, sub { say "Arguments to \U$cmd: ", join ', ', @_; $redis->$cmd(@_) }; } + + for my $cmd (qw/publish subscribe wait_for_messages/) { + dynsub uc $cmd, sub { say "Arguments to \U$cmd: ", join ', ', @_; $pubsub->$cmd(@_) }; + } } sub cp { defined $contest ? "contest.$contest." : '' }