Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * xMost of us won’t be able to use/deploy JDK 8 in production for a looong time. But that shouldn’t stop us from using it, right?
It should be possible to sneak in JDK 8 in the back way, the same way we snuck in Groovy and other libraries we wanted to use.
| /** | |
| * Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com> | |
| */ | |
| package akka.contrib.mailbox | |
| import scala.concurrent.duration._ | |
| import java.util.concurrent.atomic.AtomicInteger | |
| import java.util.concurrent.atomic.AtomicLong | |
| import com.typesafe.config.Config | |
| import akka.actor.{ ActorContext, ActorRef, ActorSystem, ExtendedActorSystem } |
| class MyManagedResource extends ResourceController[String] { | |
| def index = Action(Ok("index")) | |
| def newScreen = Action(Ok("new")) | |
| def create = Action { | |
| Redirect(MyInjectableResource.reverseRoutes.index()) | |
| } | |
| def show(id: String) = Action(Ok("Show " + id)) |