Skip to content

Instantly share code, notes, and snippets.

@fbettag
Created December 19, 2011 11:45
Show Gist options
  • Save fbettag/1496829 to your computer and use it in GitHub Desktop.
Save fbettag/1496829 to your computer and use it in GitHub Desktop.
Kernel-Side
Starting Akka...
Running Akka 2.0-M1
Deploying file:/usr/local/akka/deploy/akkaza_2.9.1-1.0.jar
[INFO] [12/19/2011 12:40:41.552] [main] [Remote] Starting remote server on [akka://[email protected]:2552]
Starting up ag.bett.scala.akkaza.AkkazaKernel
Successfully started Akka
[INFO] [12/19/2011 12:40:41.572] [DefaultDispatcher-17] [akka://[email protected]:2552/user/mgmt] Successfully linked up
[INFO] [12/19/2011 12:40:53.63] [DefaultDispatcher-6] [akka://[email protected]:2552/user/mgmt] Successfully linked up
[INFO] [12/19/2011 12:40:53.77] [DefaultDispatcher-14] [akka://[email protected]:2552/user/mgmt] rcvd: before
[INFO] [12/19/2011 12:40:53.84] [DefaultDispatcher-16] [akka://[email protected]:2552/user/mgmt] rcvd: after
case class WowzAkkaClientAuth(id: String, name: String, user: String, pass: String, platform: String)
private val conf = ConfigFactory.parseString("""
akka {
actor.provider = akka.remote.RemoteActorRefProvider
cluster.nodename = "srv1"
}
""")
val system = ActorSystem("WowzAkka", conf)
val actor = system.actorFor("akka://[email protected]:2552/user/mgmt")
val c = WowzAkkaClientAuth("1337","foo user","foo pass","foo sender","bla")
println("c: %s".format(c))
actor ! "before"
actor ! c
actor ! "after"
[INFO] [12/19/2011 12:40:52.714] [VHostHandler._defaultVHost_.11] [Remote] Starting remote server on [akka://[email protected]:2552]
[INFO] [12/19/2011 12:40:52.846] [VHostHandler._defaultVHost_.11] [Remote] Starting remote server on [akka://[email protected]:2552]
c: WowzAkkaClientAuth(1337,foo user,foo pass,foo sender,bla)
import ag.bett.scala.wowzakka._
import akka.actor._
import akka.kernel._
import akka.event.Logging
import akka.util._
import akka.util.duration._
class AkkazaKernel extends Bootable {
val system = ActorSystem("Akkaza")
def startup = {
system.actorOf(Props[AkkazaActor], "mgmt") ! "linkup"
}
def shutdown = {
system.shutdown()
}
}
class AkkazaActor extends Actor {
protected val logger = Logging(context.system, this)
def receive = {
//case a: WowzAkkaClientAuth => logger.error("Returning true!"); sender ! true
case "linkup" => logger.info("Successfully linked up")
case a: String => logger.info("rcvd: " + a)
case _ => logger.error("unhandled")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment