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 slick.driver.MySQLDriver.simple._ | |
import scala.slick.collection.heterogenous._ | |
import scala.slick.collection.heterogenous.syntax._ | |
import scala.slick.jdbc._ | |
// This is the large case class we are mapping -- 25 string fields: | |
case class BigData( | |
field1: String, | |
field2: String, | |
field3: String, |
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
#!/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
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 = { |
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 akka.actor.Actor | |
import akka.actor.ActorSystem | |
import akka.agent.Agent | |
import com.typesafe.config.ConfigFactory | |
import akka.event.Logging | |
import akka.actor.Props | |
import kafka.utils.Utils | |
import java.nio.ByteBuffer |
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
case object Run | |
case object Msg | |
class Destination extends Actor { | |
def receive = { | |
case Msg ⇒ sender ! Msg | |
} | |
} | |
class Client( |
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 model | |
import java.util.UUID | |
import play.api.libs.json.Json | |
case class Address( | |
id: Option[UUID], | |
address: Option[String], | |
number: Option[Int], |
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
if [ ! -e /home/jenkins/.gvm/scripts/gvm ] | |
then | |
wget https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer | |
chmod +x gvm-installer | |
./gvm-installer | |
fi | |
source /home/jenkins/.gvm/scripts/gvm | |
gvm install go1 |
NewerOlder