I hereby claim:
- I am henrikengstrom on github.
- I am h3nk3 (https://keybase.io/h3nk3) on keybase.
- I have a public key ASAX3TmieeXD65G9RyuVRIlnm0PC0xeetfKmZPNMboxDigo
To claim this, I am signing this object:
/** | |
* Add the following setting to the application.conf to wire things up. | |
* | |
* cinnamon.opentracing { | |
* tracers = [datadog] | |
* | |
* datadog { | |
* factory-class = "sample.DataDogTracerFactory" | |
* } | |
* } |
import akka.actor.{ ActorRef, ActorSystem, Props, Actor, ActorLogging } | |
import scala.concurrent.duration._ | |
object Common { | |
case class Greeting(greeting: String) | |
} | |
object Greeter { | |
def props(message: String, printerActor: ActorRef): Props = Props(new Greeter(message, printerActor)) | |
case object Greet |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import akka.testkit.TestActorRef | |
import org.scalatest.matchers.MustMatchers | |
import org.scalatest.WordSpec | |
import com.typesafe.config.ConfigFactory | |
import akka.actor.{Actor, ActorSystem} | |
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) | |
class Example2 extends WordSpec with MustMatchers { | |
implicit val actorSystem = ActorSystem("TestSystem", ConfigFactory.parseString("""{ test.value = "Hey, it works!" }""")) |
import akka.testkit.{TestActorRef, TestKit} | |
import com.typesafe.config.ConfigFactory | |
import org.scalatest.matchers.MustMatchers | |
import org.scalatest.WordSpec | |
import akka.actor.{Actor, ActorSystem} | |
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) | |
class Example1 extends TestKit( | |
ActorSystem("TestSystem", ConfigFactory.parseString("""{ test.value = "Hey, it works!" }"""))) | |
with WordSpec |
def receive = { | |
case actors: Int => | |
val futures = for (x <- 1 to actors) yield { | |
context.actorOf(Props[MonkeyWorker]) ? randomGenerator.nextInt(100) mapTo manifest[Set[String]] | |
} | |
Future.sequence(futures) map { wordSets => | |
val mergedSet = wordSets reduce ( (a, b) => a ++ b ) | |
val (shakespeare, unworthy) = mergedSet partition (x => Blueprint.contains(x)) | |
Result(shakespeare, unworthy) |
case POST(Path("/write")) ⇒ Action { implicit request => | |
val start = System.nanoTime | |
val numberMonkeys = writeForm.bindFromRequest.get | |
AsyncResult { | |
(shakespeare ? numberMonkeys).mapTo[Result].asPromise.map { result ⇒ | |
// We have a result - make some fancy pantsy presentation of it | |
val builder = new StringBuilder | |
builder.append("SHAKESPEARE WORDS:\n") | |
result.shakespeareMagic.foreach { w => builder.append(w + "\n") } | |
builder.append("UNWORTHY WORDS CREATED: " + result.unworthyWords.size + "\n") |
import akka.actor.{ Props, ActorSystem, Actor } | |
import akka.pattern.ask | |
import akka.util.Timeout | |
import akka.util.duration._ | |
import akka.dispatch.Await | |
import util.Random | |
object DangerousOpTest extends App { | |
println("starting system") | |
val system = ActorSystem("daOp") |
calculator { | |
include "common" | |
akka { | |
remote.netty.port = 2552 | |
} | |
} | |
remotelookup { | |
include "common" |