@@ -2,8 +2,8 @@ package com.redis
22
33object Util {
44 object Break extends RuntimeException
5- def break { throw Break }
6- def whileTrue (block : => Unit ) {
5+ def break : Unit = { throw Break }
6+ def whileTrue (block : => Unit ): Unit = {
77 while (true )
88 try {
99 block
@@ -23,12 +23,12 @@ trait PubSub extends PubOperations { self: Redis =>
2323
2424 class Consumer (fn : PubSubMessage => Any ) extends Runnable {
2525
26- def start () {
26+ def start (): Unit = {
2727 val myThread = new Thread (this ) ;
2828 myThread.start() ;
2929 }
3030
31- override def run () {
31+ override def run (): Unit = {
3232 try {
3333 whileTrue {
3434 asList match {
@@ -62,7 +62,7 @@ trait PubSub extends PubOperations { self: Redis =>
6262 }
6363 }
6464
65- def pSubscribe (channel : String , channels : String * )(fn : PubSubMessage => Any ) {
65+ def pSubscribe (channel : String , channels : String * )(fn : PubSubMessage => Any ): Unit = {
6666 if (pubSub) { // already pubsub ing
6767 pSubscribeRaw(channel, channels : _* )
6868 return
@@ -72,7 +72,7 @@ trait PubSub extends PubOperations { self: Redis =>
7272 new Consumer (fn).start()
7373 }
7474
75- def pSubscribeRaw (channel : String , channels : String * ) {
75+ def pSubscribeRaw (channel : String , channels : String * ): Unit = {
7676 send(" PSUBSCRIBE" , channel :: channels.toList)(())
7777 }
7878
@@ -83,7 +83,7 @@ trait PubSub extends PubOperations { self: Redis =>
8383 def pUnsubscribe (channel : String , channels : String * ): Unit = {
8484 send(" PUNSUBSCRIBE" , channel :: channels.toList)(())
8585 }
86- def subscribe (channel : String , channels : String * )(fn : PubSubMessage => Any ) {
86+ def subscribe (channel : String , channels : String * )(fn : PubSubMessage => Any ): Unit = {
8787 if (pubSub) { // already pubsub ing
8888 subscribeRaw(channel, channels : _* )
8989 } else {
@@ -93,7 +93,7 @@ trait PubSub extends PubOperations { self: Redis =>
9393 }
9494 }
9595
96- def subscribeRaw (channel : String , channels : String * ) {
96+ def subscribeRaw (channel : String , channels : String * ): Unit = {
9797 send(" SUBSCRIBE" , channel :: channels.toList)(())
9898 }
9999
0 commit comments