Permalink
Browse files

fix issue

  • Loading branch information...
cofyc committed Sep 5, 2012
1 parent 7ef120a commit f7a151bf38e09c13c9a4dc3dc68bfc71949aa91b
Showing with 39 additions and 0 deletions.
  1. +24 −0 lib/Redis.pm
  2. +15 −0 t/02-pub;pma&sub.t
View
@@ -750,4 +750,28 @@ method zunionstore(Str $destination, *@keys, :WEIGHTS(@weights)?, :AGGREGATE(@ag
###### ! Commands/SortedSets #######
+###### Commands/Pub&Sub #######
+
+method psubscribe(*@patterns) {
+ return self!exec_command("PSUBSCRIBE", |@patterns);
+}
+
+method publish(Str $channel, $message) {
+ return self!exec_command("PUBLISH", $channel, $message);
+}
+
+method punsubscribe(*@patterns) {
+ return self!exec_command("PUNSUBSCRIBE", |@patterns);
+}
+
+method subscribe(*@channels) {
+ return self!exec_command("SUBSCRIBE", |@channels);
+}
+
+method unsubscribe(*@channels) {
+ return self!exec_command("UNSUBSCRIBE", |@channels);
+}
+
+###### ! Commands/Pub&Sub #######
+
# vim: ft=perl6
View
@@ -0,0 +1,15 @@
+use v6;
+
+BEGIN { @*INC.push('t/') };
+use Redis;
+use Test;
+use Test::SpawnRedisServer;
+
+my $r = Redis.new(decode_response => True);
+$r.connect;
+$r.flushall;
+
+plan 1;
+
+# TODO
+is_deeply $r.publish("queue", "data"), 0;

0 comments on commit f7a151b

Please sign in to comment.