Added remoting capabilities

parent a0b6d307
......@@ -30,5 +30,9 @@
<orderEntry type="library" scope="TEST" name="Gradle: org.scalatest:scalatest_2.11:2.2.5" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.scala-lang:scala-reflect:2.11.2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.scala-lang.modules:scala-xml_2.11:1.0.2" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.typesafe.akka:akka-remote_2.11:2.3.9" level="project" />
<orderEntry type="library" exported="" name="Gradle: io.netty:netty:3.8.0.Final" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.google.protobuf:protobuf-java:2.5.0" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.uncommons.maths:uncommons-maths:1.2.2a" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -24,6 +24,7 @@ dependencies {
"org.scala-lang:scala-library:2.11.5",
"com.typesafe.akka:akka-actor_2.11:${akkaVersion}",
"com.typesafe.akka:akka-slf4j_2.11:${akkaVersion}",
"com.typesafe.akka:akka-remote_2.11:${akkaVersion}",
"ch.qos.logback:logback-core:1.1.2",
"ch.qos.logback:logback-classic:1.1.2"
......
akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = "127.0.0.1"
port = 1337
}
}
}
\ No newline at end of file
package no.nsd.akkapres.remote
import akka.actor.{Props, ActorSystem}
object AkkaPresRemote extends App {
implicit val actorSystem = ActorSystem("akkapres-remote")
val helloActor = actorSystem.actorOf(Props[RemoteHelloActor], name = "hello")
helloActor ! "START"
}
package no.nsd.akkapres.remote
import akka.actor.{Actor, ActorLogging}
/**
* @author Dag Østgulen Heradstveit
*/
class RemoteHelloActor extends Actor with ActorLogging {
def receive = {
case "START" =>
log.info("Starting actor locally")
case "PING" =>
log.info("PONG!!!!!")
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment