Skip to content

Instantly share code, notes, and snippets.

@hussachai
Created January 27, 2016 19:18
Show Gist options
  • Save hussachai/c60d93ee20b690675c2c to your computer and use it in GitHub Desktop.
Save hussachai/c60d93ee20b690675c2c to your computer and use it in GitHub Desktop.
class SubscribeActor(redis: RedisClient, out: ActorRef,
channels: Seq[String] = Nil, patterns: Seq[String] = Nil) extends RedisSubscriberActor(
new InetSocketAddress(redis.host, redis.port), channels, patterns,
onConnectStatus = connected => { println(s"connected: $connected") }) {
def onMessage(message: Message) {
out ! message.data.decodeString("UTF-8")
}
def onPMessage(pmessage: PMessage) {}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment