|
Akka/Scala example source code file (FactorialFrontendMain.java)
The FactorialFrontendMain.java Akka example source codepackage sample.cluster.factorial; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import akka.actor.ActorSystem; import akka.actor.Props; import akka.cluster.Cluster; public class FactorialFrontendMain { public static void main(String[] args) { final int upToN = 200; final Config config = ConfigFactory.parseString( "akka.cluster.roles = [frontend]").withFallback( ConfigFactory.load("factorial")); final ActorSystem system = ActorSystem.create("ClusterSystem", config); system.log().info( "Factorials will start when 2 backend members in the cluster."); //#registerOnUp Cluster.get(system).registerOnMemberUp(new Runnable() { @Override public void run() { system.actorOf(Props.create(FactorialFrontend.class, upToN, true), "factorialFrontend"); } }); //#registerOnUp } } Other Akka source code examplesHere is a short list of links related to this Akka FactorialFrontendMain.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.