Commit e1864fa9 authored by Dominik Charousset's avatar Dominik Charousset

spawn worker above guardian actor, chain links above chain masters

parent 0efa33c2
...@@ -168,11 +168,11 @@ class AkkaChainLink(next: AkkaActorRef) extends AkkaActor { ...@@ -168,11 +168,11 @@ class AkkaChainLink(next: AkkaActorRef) extends AkkaActor {
class AkkaChainMaster(supervisor: AkkaActorRef, system: ActorSystem) extends AkkaActor { class AkkaChainMaster(supervisor: AkkaActorRef, system: ActorSystem) extends AkkaActor {
val worker = context.actorOf(Props(new AkkaWorker(supervisor))) val worker = system.actorOf(Props(new AkkaWorker(supervisor)))
@tailrec final def newRing(next: AkkaActorRef, rsize: Int): AkkaActorRef = { @tailrec final def newRing(next: AkkaActorRef, rsize: Int): AkkaActorRef = {
if (rsize == 0) next if (rsize == 0) next
else newRing(system.actorOf(Props(new AkkaChainLink(next))), rsize-1) else newRing(context.actorOf(Props(new AkkaChainLink(next))), rsize-1)
} }
def initialized(ringSize: Int, initialTokenValue: Int, repetitions: Int, next: AkkaActorRef, iteration: Int): Receive = { def initialized(ringSize: Int, initialTokenValue: Int, repetitions: Int, next: AkkaActorRef, iteration: Int): Receive = {
......
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