diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/PromiseStreamSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/PromiseStreamSpec.scala index b3ce0108dd..7ac129e254 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/PromiseStreamSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/PromiseStreamSpec.scala @@ -95,6 +95,17 @@ class PromiseStreamSpec extends AkkaSpec with DefaultTimeout { assert(Await.result(c, timeout.duration) === 4) } + "map futures" in { + val q = PromiseStream[String]() + flow { + q << (Future("a"), Future("b"), Future("c")) + } + val a, b, c = q.dequeue + Await.result(a, timeout.duration) must be("a") + Await.result(b, timeout.duration) must be("b") + Await.result(c, timeout.duration) must be("c") + } + "not fail under concurrent stress" in { implicit val timeout = Timeout(60 seconds) val q = PromiseStream[Long](timeout.duration.toMillis) diff --git a/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala b/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala index b1c25f55e1..882219f84d 100644 --- a/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala +++ b/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala @@ -246,7 +246,10 @@ class PromiseStream[A](implicit val dispatcher: MessageDispatcher, val timeout: shift { cont: (PromiseStream[A] ⇒ Future[Any]) ⇒ elem map (a ⇒ cont(this += a)) } final def <<(elem1: Future[A], elem2: Future[A], elems: Future[A]*): PromiseStream[A] @cps[Future[Any]] = - shift { cont: (PromiseStream[A] ⇒ Future[Any]) ⇒ Future.flow(this << elem1 << elem2 <<< Future.sequence(elems.toSeq)) map cont } + shift { cont: (PromiseStream[A] ⇒ Future[Any]) ⇒ + val seq = Future.sequence(elem1 +: elem2 +: elems) + seq map (a ⇒ cont(this ++= a)) + } final def <<<(elems: Traversable[A]): PromiseStream[A] @cps[Future[Any]] = shift { cont: (PromiseStream[A] ⇒ Future[Any]) ⇒ cont(this ++= elems) } diff --git a/akka-docs/dev/building-akka.rst b/akka-docs/dev/building-akka.rst index 495d8ba5ed..d0cffbac86 100644 --- a/akka-docs/dev/building-akka.rst +++ b/akka-docs/dev/building-akka.rst @@ -21,11 +21,11 @@ Akka uses `Git`_ and is hosted at `Github`_. .. _Github: http://github.com You first need Git installed on your machine. You can then clone the source -repository from http://github.com/jboner/akka. +repository from http://github.com/akka/akka. For example:: - git clone git://github.com/jboner/akka.git + git clone git://github.com/akka/akka.git If you have already cloned the repository previously then you can update the code with ``git pull``:: diff --git a/akka-docs/dev/developer-guidelines.rst b/akka-docs/dev/developer-guidelines.rst index 138d774619..bc52613d47 100644 --- a/akka-docs/dev/developer-guidelines.rst +++ b/akka-docs/dev/developer-guidelines.rst @@ -44,12 +44,12 @@ All code that is checked in **should** have tests. All testing is done with ``Sc * Name tests as **Test.scala** if they do not depend on any external stuff. That keeps surefire happy. * Name tests as **Spec.scala** if they have external dependencies. -There is a testing standard that should be followed: `Ticket001Spec `_ +There is a testing standard that should be followed: `Ticket001Spec `_ Actor TestKit ^^^^^^^^^^^^^ -There is a useful test kit for testing actors: `akka.util.TestKit `_. It enables assertions concerning replies received and their timing, there is more documentation in the :ref:`akka-testkit` module. +There is a useful test kit for testing actors: `akka.util.TestKit `_. It enables assertions concerning replies received and their timing, there is more documentation in the :ref:`akka-testkit` module. Multi-JVM Testing ^^^^^^^^^^^^^^^^^ diff --git a/akka-docs/disabled/external-sample-projects.rst b/akka-docs/disabled/external-sample-projects.rst index 80e56823af..3d9aeddba6 100644 --- a/akka-docs/disabled/external-sample-projects.rst +++ b/akka-docs/disabled/external-sample-projects.rst @@ -139,7 +139,7 @@ Akka Benchmark project ^^^^^^^^^^^^^^^^^^^^^^ Benches Akka against various other actors and concurrency tools -``_ +``_ Typed Actor (Java API) sample project ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/akka-docs/index.rst b/akka-docs/index.rst index 5bd1b7ed80..f631987945 100644 --- a/akka-docs/index.rst +++ b/akka-docs/index.rst @@ -22,7 +22,7 @@ Links * `Downloads `_ -* `Source Code `_ +* `Source Code `_ * :ref:`scaladoc` diff --git a/akka-docs/intro/getting-started-first-java.rst b/akka-docs/intro/getting-started-first-java.rst index a943555d4e..0a090d02bd 100644 --- a/akka-docs/intro/getting-started-first-java.rst +++ b/akka-docs/intro/getting-started-first-java.rst @@ -30,12 +30,12 @@ Tutorial source code If you want don't want to type in the code and/or set up a Maven project then you can check out the full tutorial from the Akka GitHub repository. It is in the ``akka-tutorials/akka-tutorial-first`` module. You can also browse it online `here`__, with the actual source code `here`__. -__ https://github.com/jboner/akka/tree/master/akka-tutorials/akka-tutorial-first -__ https://github.com/jboner/akka/blob/master/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java +__ https://github.com/akka/akka/tree/master/akka-tutorials/akka-tutorial-first +__ https://github.com/akka/akka/blob/master/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java To check out the code using Git invoke the following:: - $ git clone git://github.com/jboner/akka.git + $ git clone git://github.com/akka/akka.git Then you can navigate down to the tutorial:: diff --git a/akka-docs/intro/getting-started-first-scala-eclipse.rst b/akka-docs/intro/getting-started-first-scala-eclipse.rst index 8cb0e531ae..635a3710fd 100644 --- a/akka-docs/intro/getting-started-first-scala-eclipse.rst +++ b/akka-docs/intro/getting-started-first-scala-eclipse.rst @@ -46,12 +46,12 @@ check out the full tutorial from the Akka GitHub repository. It is in the ``akka-tutorials/akka-tutorial-first`` module. You can also browse it online `here`__, with the actual source code `here`__. -__ https://github.com/jboner/akka/tree/master/akka-tutorials/akka-tutorial-first -__ https://github.com/jboner/akka/blob/master/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala +__ https://github.com/akka/akka/tree/master/akka-tutorials/akka-tutorial-first +__ https://github.com/akka/akka/blob/master/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala To check out the code using Git invoke the following:: - $ git clone git://github.com/jboner/akka.git + $ git clone git://github.com/akka/akka.git Then you can navigate down to the tutorial:: diff --git a/akka-docs/intro/getting-started-first-scala.rst b/akka-docs/intro/getting-started-first-scala.rst index 702c996291..85dd29cbc9 100644 --- a/akka-docs/intro/getting-started-first-scala.rst +++ b/akka-docs/intro/getting-started-first-scala.rst @@ -48,12 +48,12 @@ check out the full tutorial from the Akka GitHub repository. It is in the ``akka-tutorials/akka-tutorial-first`` module. You can also browse it online `here`__, with the actual source code `here`__. -__ https://github.com/jboner/akka/tree/master/akka-tutorials/akka-tutorial-first -__ https://github.com/jboner/akka/blob/master/akka-tutorials/akka-tutorial-first/src/main/scala/akka/tutorial/first/scala/Pi.scala +__ https://github.com/akka/akka/tree/master/akka-tutorials/akka-tutorial-first +__ https://github.com/akka/akka/blob/master/akka-tutorials/akka-tutorial-first/src/main/scala/akka/tutorial/first/scala/Pi.scala To check out the code using Git invoke the following:: - $ git clone git://github.com/jboner/akka.git + $ git clone git://github.com/akka/akka.git Then you can navigate down to the tutorial:: diff --git a/akka-docs/intro/getting-started.rst b/akka-docs/intro/getting-started.rst index 75f62a39d9..748ebbc6b0 100644 --- a/akka-docs/intro/getting-started.rst +++ b/akka-docs/intro/getting-started.rst @@ -159,7 +159,7 @@ Build from sources Akka uses Git and is hosted at `Github `_. -* Akka: clone the Akka repository from ``_ +* Akka: clone the Akka repository from ``_ Continue reading the page on :ref:`building-akka` diff --git a/akka-docs/java/event-bus.rst b/akka-docs/java/event-bus.rst index f97156e9e3..cb5bd5644b 100644 --- a/akka-docs/java/event-bus.rst +++ b/akka-docs/java/event-bus.rst @@ -48,7 +48,7 @@ The classifiers presented here are part of the Akka distribution, but rolling your own in case you do not find a perfect match is not difficult, check the implementation of the existing ones on `github`_. -.. _github: https://github.com/jboner/akka/blob/master/akka-actor/src/main/scala/akka/event/EventBus.scala +.. _github: https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/event/EventBus.scala Lookup Classification --------------------- diff --git a/akka-docs/java/remoting.rst b/akka-docs/java/remoting.rst index 427e81c58c..376eab2584 100644 --- a/akka-docs/java/remoting.rst +++ b/akka-docs/java/remoting.rst @@ -149,7 +149,7 @@ Description of the Remoting Sample There is a more extensive remote example that comes with the Akka distribution. Please have a look here for more information: `Remote Sample -`_ +`_ This sample demonstrates both, remote deployment and look-up of remote actors. First, let us have a look at the common setup for both scenarios (this is ``common.conf``): diff --git a/akka-docs/java/routing.rst b/akka-docs/java/routing.rst index aeb89c2506..9c61779063 100644 --- a/akka-docs/java/routing.rst +++ b/akka-docs/java/routing.rst @@ -327,7 +327,7 @@ from incoming sender/message to a ``List`` of ``Destination(sender, routee)``. The sender is what "parent" the routee should see - changing this could be useful if you for example want another actor than the original sender to intermediate the result of the routee (if there is a result). For more information about how to alter the original sender we refer to the source code of -`ScatterGatherFirstCompletedRouter `_ +`ScatterGatherFirstCompletedRouter `_ All in all the custom router looks like this: diff --git a/akka-docs/project/licenses.rst b/akka-docs/project/licenses.rst index 0d7417e44e..d7d9865b31 100644 --- a/akka-docs/project/licenses.rst +++ b/akka-docs/project/licenses.rst @@ -196,4 +196,4 @@ Licenses for Dependency Libraries --------------------------------- Each dependency and its license can be seen in the project build file (the comment on the side of each dependency): -``_ +``_ diff --git a/akka-docs/project/links.rst b/akka-docs/project/links.rst index 8b387eceb5..f9ea25bac7 100644 --- a/akka-docs/project/links.rst +++ b/akka-docs/project/links.rst @@ -20,12 +20,12 @@ Akka is now part of the `Typesafe Stack `_. ``_ -`Source Code `_ +`Source Code `_ ============================================== Akka uses Git and is hosted at `Github `_. -* Akka: clone the Akka repository from ``_ +* Akka: clone the Akka repository from ``_ `Releases Repository `_ diff --git a/akka-docs/scala/actors.rst b/akka-docs/scala/actors.rst index eb8bab25ed..7c0553fea7 100644 --- a/akka-docs/scala/actors.rst +++ b/akka-docs/scala/actors.rst @@ -567,7 +567,7 @@ The ``become`` method is useful for many different things, but a particular nice example of it is in example where it is used to implement a Finite State Machine (FSM): `Dining Hakkers`_. -.. _Dining Hakkers: http://github.com/jboner/akka/blob/master/akka-samples/akka-sample-fsm/src/main/scala/DiningHakkersOnBecome.scala +.. _Dining Hakkers: http://github.com/akka/akka/blob/master/akka-samples/akka-sample-fsm/src/main/scala/DiningHakkersOnBecome.scala Here is another little cute example of ``become`` and ``unbecome`` in action: @@ -576,7 +576,7 @@ Here is another little cute example of ``become`` and ``unbecome`` in action: Encoding Scala Actors nested receives without accidentally leaking memory ------------------------------------------------------------------------- -See this `Unnested receive example `_. +See this `Unnested receive example `_. Downgrade diff --git a/akka-docs/scala/event-bus.rst b/akka-docs/scala/event-bus.rst index 633bd0ca64..65e476fb9a 100644 --- a/akka-docs/scala/event-bus.rst +++ b/akka-docs/scala/event-bus.rst @@ -49,7 +49,7 @@ The classifiers presented here are part of the Akka distribution, but rolling your own in case you do not find a perfect match is not difficult, check the implementation of the existing ones on `github`_. -.. _github: https://github.com/jboner/akka/blob/master/akka-actor/src/main/scala/akka/event/EventBus.scala +.. _github: https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/event/EventBus.scala Lookup Classification --------------------- diff --git a/akka-docs/scala/fsm.rst b/akka-docs/scala/fsm.rst index f0f2758e89..f9e95105ce 100644 --- a/akka-docs/scala/fsm.rst +++ b/akka-docs/scala/fsm.rst @@ -493,5 +493,5 @@ Examples A bigger FSM example contrasted with Actor's :meth:`become`/:meth:`unbecome` can be found in the sources: - * `Dining Hakkers using FSM `_ - * `Dining Hakkers using become `_ + * `Dining Hakkers using FSM `_ + * `Dining Hakkers using become `_ diff --git a/akka-docs/scala/remoting.rst b/akka-docs/scala/remoting.rst index 9ccd41366a..6beda42871 100644 --- a/akka-docs/scala/remoting.rst +++ b/akka-docs/scala/remoting.rst @@ -166,7 +166,7 @@ Description of the Remoting Sample There is a more extensive remote example that comes with the Akka distribution. Please have a look here for more information: `Remote Sample -`_ +`_ This sample demonstrates both, remote deployment and look-up of remote actors. First, let us have a look at the common setup for both scenarios (this is ``common.conf``): diff --git a/akka-docs/scala/routing.rst b/akka-docs/scala/routing.rst index 92776fa73f..541ed5c525 100644 --- a/akka-docs/scala/routing.rst +++ b/akka-docs/scala/routing.rst @@ -328,14 +328,14 @@ As you can see above what's returned in the partial function is a ``List`` of `` The sender is what "parent" the routee should see - changing this could be useful if you for example want another actor than the original sender to intermediate the result of the routee (if there is a result). For more information about how to alter the original sender we refer to the source code of -`ScatterGatherFirstCompletedRouter `_ +`ScatterGatherFirstCompletedRouter `_ All in all the custom router looks like this: .. includecode:: ../../akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala#CustomRouter If you are interested in how to use the VoteCountRouter you can have a look at the test class -`RoutingSpec `_ +`RoutingSpec `_ Configured Custom Router ************************