Last active
August 29, 2015 14:00
-
-
Save dcaoyuan/11204015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val observer = new Observer[OnEvent] { | |
override def onNext(value: OnEvent) { | |
case OnEvent("Hi!", args, context) => | |
if (value.packet.hasAckData) { | |
value.ack("[]") | |
} | |
value.reply("welcome", List(Msg("Greeting")).toJson.toString) | |
} | |
} | |
val channel = Subject[OnData]() | |
channel.ofType[OnEvent].filter(_.name == "Hi!").subscribe(observer) | |
namespaceExt.namespace("test") ! Namespace.Subscribe(channel) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment