diff options
Diffstat (limited to 'kamon-core/src/main/scala/test')
-rw-r--r-- | kamon-core/src/main/scala/test/SimpleRequestProcessor.scala (renamed from kamon-core/src/main/scala/test/PingPong.scala) | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/kamon-core/src/main/scala/test/PingPong.scala b/kamon-core/src/main/scala/test/SimpleRequestProcessor.scala index 8808e4bf..5b216b39 100644 --- a/kamon-core/src/main/scala/test/PingPong.scala +++ b/kamon-core/src/main/scala/test/SimpleRequestProcessor.scala @@ -1,57 +1,12 @@ package test import akka.actor._ -import java.util.concurrent.atomic.AtomicLong import kamon.Tracer import spray.routing.SimpleRoutingApp import akka.util.Timeout import spray.httpx.RequestBuilding import scala.concurrent.{Await, Future} -object PingPong extends App { - import scala.concurrent.duration._ - val counter = new AtomicLong - - val as = ActorSystem("ping-pong") - import as.dispatcher - - Tracer.start - - for(i <- 1 to 64) { - val pinger = as.actorOf(Props[Pinger]) - val ponger = as.actorOf(Props[Ponger]) - - for(_ <- 1 to 256) { - pinger.tell(Pong, ponger) - } - } - - as.scheduler.schedule(1 second, 1 second) { - println("Processed: " + counter.getAndSet(0)) - } -} - -case object Ping -case object Pong - -class Pinger extends Actor { - def receive = { - case Pong => { - sender ! Ping - PingPong.counter.incrementAndGet() - } - } -} - -class Ponger extends Actor { - def receive = { - case Ping => { - sender ! Pong; PingPong.counter.incrementAndGet() - } - } -} - - object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuilding { import scala.concurrent.duration._ import spray.client.pipelining._ @@ -98,7 +53,6 @@ object Verifier extends App { def go: Unit = { import scala.concurrent.duration._ import spray.client.pipelining._ - import akka.pattern.ask implicit val system = ActorSystem("test") import system.dispatcher |