Update tutorials and include source in the distribution
This commit is contained in:
parent
c581e4be28
commit
8dec4bcbc4
18 changed files with 243 additions and 194 deletions
7
akka-tutorials/akka-tutorial-first/README
Normal file
7
akka-tutorials/akka-tutorial-first/README
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
================
|
||||
First Tutorial
|
||||
================
|
||||
|
||||
This is the source code for the first tutorial.
|
||||
|
||||
See the Akka Documentation for information about this tutorial.
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
<groupId>akka.tutorial.first.java</groupId>
|
||||
<artifactId>akka-tutorial-first-java</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<url>http://akka.io</url>
|
||||
|
||||
<dependencies>
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<repository>
|
||||
<id>Akka</id>
|
||||
<name>Akka Maven2 Repository</name>
|
||||
<url>http://www.scalablesolutions.se/akka/repository/</url>
|
||||
<url>http://akka.io/repository/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
project.organization=akka.tutorial.first.scala
|
||||
project.name=akka-tutorial-first-scala
|
||||
project.version=1.2-SNAPSHOT
|
||||
build.scala.versions=2.9.0.RC3
|
||||
sbt.version=0.7.6.RC0
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import sbt._
|
||||
|
||||
class TutorialOneProject(info: ProjectInfo) extends DefaultProject(info) with AkkaProject
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import sbt._
|
||||
|
||||
class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
|
||||
val akkaRepo = "Akka Repo" at "http://akka.io/repository"
|
||||
val akkaPlugin = "se.scalablesolutions.akka" % "akka-sbt-plugin" % "1.2-SNAPSHOT"
|
||||
}
|
||||
|
|
@ -18,31 +18,6 @@ import akka.routing.UntypedLoadBalancer;
|
|||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
/**
|
||||
* First part in Akka tutorial for Java.
|
||||
* <p/>
|
||||
* Calculates Pi.
|
||||
* <p/>
|
||||
* Run on command line:
|
||||
* <pre>
|
||||
* $ cd akka-1.1
|
||||
* $ export AKKA_HOME=`pwd`
|
||||
* $ javac -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar akka/tutorial/first/java/Pi.java
|
||||
* $ java -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar:. akka.tutorial.first.java.Pi
|
||||
* $ ...
|
||||
* </pre>
|
||||
* <p/>
|
||||
* Run it in Maven:
|
||||
* <pre>
|
||||
* $ mvn
|
||||
* > scala:console
|
||||
* > val pi = new akka.tutorial.first.java.Pi
|
||||
* > pi.calculate(4, 10000, 10000)
|
||||
* > ...
|
||||
* </pre>
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
public class Pi {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
|
|
|||
|
|
@ -12,32 +12,6 @@ import Routing._
|
|||
import System.{currentTimeMillis => now}
|
||||
import java.util.concurrent.CountDownLatch
|
||||
|
||||
/**
|
||||
* First part in Akka tutorial.
|
||||
* <p/>
|
||||
* Calculates Pi.
|
||||
* <p/>
|
||||
* Run on command line:
|
||||
* <pre>
|
||||
* $ cd akka-1.1
|
||||
* $ export AKKA_HOME=`pwd`
|
||||
* $ scalac -cp dist/akka-actor-1.2-SNAPSHOT.jar Pi.scala
|
||||
* $ java -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar:. akka.tutorial.first.scala.Pi
|
||||
* $ ...
|
||||
* </pre>
|
||||
* <p/>
|
||||
* Run it in SBT:
|
||||
* <pre>
|
||||
* $ sbt
|
||||
* > update
|
||||
* > console
|
||||
* > akka.tutorial.first.scala.Pi.calculate(nrOfWorkers = 4, nrOfElements = 10000, nrOfMessages = 10000)
|
||||
* > ...
|
||||
* > :quit
|
||||
* </pre>
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
object Pi extends App {
|
||||
|
||||
calculate(nrOfWorkers = 4, nrOfElements = 10000, nrOfMessages = 10000)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue