format source with scalafmt
This commit is contained in:
parent
0f40491d42
commit
ce404e4f53
1669 changed files with 43208 additions and 35404 deletions
|
|
@ -20,7 +20,11 @@ class FactorialBackend extends Actor with ActorLogging {
|
|||
|
||||
def receive = {
|
||||
case (n: Int) =>
|
||||
Future(factorial(n)) map { result => (n, result) } pipeTo sender()
|
||||
Future(factorial(n))
|
||||
.map { result =>
|
||||
(n, result)
|
||||
}
|
||||
.pipeTo(sender())
|
||||
}
|
||||
|
||||
def factorial(n: Int): BigInt = {
|
||||
|
|
@ -38,9 +42,10 @@ object FactorialBackend {
|
|||
def main(args: Array[String]): Unit = {
|
||||
// Override the configuration of the port when specified as program argument
|
||||
val port = if (args.isEmpty) "0" else args(0)
|
||||
val config = ConfigFactory.parseString(s"akka.remote.netty.tcp.port=$port").
|
||||
withFallback(ConfigFactory.parseString("akka.cluster.roles = [backend]")).
|
||||
withFallback(ConfigFactory.load("factorial"))
|
||||
val config = ConfigFactory
|
||||
.parseString(s"akka.remote.netty.tcp.port=$port")
|
||||
.withFallback(ConfigFactory.parseString("akka.cluster.roles = [backend]"))
|
||||
.withFallback(ConfigFactory.load("factorial"))
|
||||
|
||||
val system = ActorSystem("ClusterSystem", config)
|
||||
system.actorOf(Props[FactorialBackend], name = "factorialBackend")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue