This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name := "project" | |
| scalaVersion in ThisBuild := "2.11.8" | |
| lazy val commonSettings = Seq( | |
| organization := "com.mycompany", | |
| version := "0.0.1", | |
| test in assembly := {}, | |
| parallelExecution in Test := false | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.vivareal.locations.domain.services.address | |
| import com.vivareal.locations.domain.model.address.Address | |
| import com.vivareal.locations.infrastructure.aws.elasticache.ElastiCache | |
| import scala.concurrent.Future | |
| class CacheBuilder { | |
| private val cache: ElastiCache[Address] = new ElastiCache[Address] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.gatling.test | |
| import com.typesafe.config.ConfigFactory | |
| import com.webtrekk.cdb.cassandra.entity.AccessId | |
| import com.webtrekk.cdb.cassandra.service.AccessIdService | |
| import io.gatling.core.Predef._ | |
| import io.gatling.http.Predef._ | |
| import scala.collection.JavaConversions._ | |
| import scala.concurrent.Await |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Inspired by a tweet from @trautonen 1/13/2016 | |
| // Use Source.unfoldAsync to turn paginated database results into an akka-streams Source | |
| // unfold is the inverse of fold | |
| case class Page[T](pageNumber:Long, totalPages:Long, contents:List[T]) | |
| case class Thing(id: Long, name: String = "foo") | |
| val totalPages = 5 // | |
| val pageSize = 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import scala.concurrent.duration.Duration | |
| import scala.concurrent.{Await, Future} | |
| /** | |
| * Created by thiago on 3/10/16. | |
| */ | |
| object EitherTest extends App { | |
| //given a list of ids |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Run the benchmark with this as sbt start script, | |
| # but change the paths (/home/nordwall) | |
| # ~/bin/sbt-benchmark.sh | |
| # > project akka-actor-tests | |
| # > test-only akka.performance.microbench.TellThroughputPerformanceSpec | |
| export JAVA=/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java | |
| export FLAGS="-server -Dfile.encoding=UTF8 -XX:+UseNUMA -XX:+UseCondCardMark -XX:-UseBiasedLocking" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### DML ### | |
| # Keyspace Name | |
| keyspace: stresscql | |
| # The CQL for creating a keyspace (optional if it already exists) | |
| keyspace_definition: | | |
| CREATE KEYSPACE stresscql WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; | |
| # Table name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package question | |
| import java.io.IOException | |
| import scala.util.Random | |
| import akka.actor.Actor | |
| import akka.actor.ActorRef | |
| import akka.actor.ActorSystem | |
| import akka.actor.OneForOneStrategy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.UUID | |
| import scala.annotation.tailrec | |
| /** | |
| * Created by Thiago Pereira on 8/4/15. | |
| */ | |
| case class Employee(id: UUID, name: String, parent: Option[Employee]) | |
| object TailRecTest { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.example | |
| import akka.actor._ | |
| import akka.camel.{ CamelMessage, Consumer, CamelExtension } | |
| import org.apache.activemq.camel.component.ActiveMQComponent | |
| class CdrLogConsumer extends Actor with Consumer { | |
| def endpointUri = "activemq:FOO.BAR" | |
| def receive = { |