This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorSystem | |
import akka.dispatch._ | |
import akka.util.Duration | |
object MapFilter extends App { | |
implicit val system = ActorSystem() | |
val f = Future.traverse(List(Future(1 + 2), Future(11 + 2), Future(3 + 5))) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Tango</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main/java/com/micronautics/akka/dispatch/future/FoldJava.java b/src/main/java/com/micronautics/akka/dispatch/future/FoldJava.java | |
index 71c51bc..a7aa00f 100755 | |
--- a/src/main/java/com/micronautics/akka/dispatch/future/FoldJava.java | |
+++ b/src/main/java/com/micronautics/akka/dispatch/future/FoldJava.java | |
@@ -23,7 +23,7 @@ import java.util.ArrayList; | |
* Non-blocking fold is executed on the thread of the last Future to be completed. | |
* If this Future is completed with an exception then the new Future will also contain this exception. | |
* @see https://github.com/jboner/akka/blob/releasing-2.0-M2/akka-docs/java/code/akka/docs/future/FutureDocTestBase.java */ | |
-class FoldJava { | |
+public class FoldJava { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala | |
index b7f2afc..1663db6 100644 | |
--- a/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala | |
+++ b/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala | |
@@ -7,8 +7,9 @@ package akka.dispatch | |
import java.util.concurrent._ | |
import akka.event.Logging.Error | |
import akka.util.{ Duration, Switch, ReentrantGuard } | |
-import atomic.{ AtomicInteger, AtomicLong } | |
+import atomic.{ AtomicReferenceFieldUpdater, AtomicInteger, AtomicLong } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/test/scala/com/redis/Patterns.scala b/src/test/scala/com/redis/Patterns.scala | |
index 0870ca0..03d9b8f 100644 | |
--- a/src/test/scala/com/redis/Patterns.scala | |
+++ b/src/test/scala/com/redis/Patterns.scala | |
@@ -55,7 +55,7 @@ object Patterns { | |
// entering gather phase | |
val allSum = | |
- allPushes onSuccess {result => | |
+ allPushes flatMap {result => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Foo { | |
def value: Int | |
} | |
class Bar(val value: Int) extends Foo | |
class Baz(val value: Int) extends Foo | |
trait Foo2[-A] extends Foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/akka-actor/src/main/scala/akka/actor/ActorRef.scala b/akka-actor/src/main/scala/akka/actor/ActorRef.scala | |
index 5609489..0e7f3e7 100644 | |
--- a/akka-actor/src/main/scala/akka/actor/ActorRef.scala | |
+++ b/akka-actor/src/main/scala/akka/actor/ActorRef.scala | |
@@ -303,7 +303,7 @@ abstract class ActorRef extends ActorRefShared with ForwardableChannel with Repl | |
* | |
* If you would rather have an exception, check the <code>reply(..)</code> version. | |
*/ | |
- def tryReply(message: Any): Boolean = channel.tryTell(message, this) | |
+ def tryReply(message: Any): Boolean = channel.tryTell(message)(this) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def multi[T](cmd: RedisClientMulti => Queued[T]): T | |
r.multi { q => | |
for { | |
_ <- q.put("mykey", "myval") | |
x <- q.get("myotherkey").parse[String] | |
y <- q.get("important").parse[Int] | |
} yield (x, y) // Queued[(Future[Option[String]], Future[Option[Int]])] | |
} // (Future[Option[String]], Future[Option[Int]]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.util.continuations._ | |
import scala.util.Random | |
class Generator[+T](f : () => T) { | |
def apply() : T @cps[Generator[Any]] = shift { this flatMap _ } | |
def generate(n : Int) : IndexedSeq[T] = 0 to n map (x => get) | |
def get = f() | |
def flatMap[TT](ff : T => Generator[TT]) = new Generator( () => ff(get).get ) | |
def map[TT](ff : T => TT) = new Generator( () => ff(get) ) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala | |
index e12294a..c90ddb9 100644 | |
--- a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala | |
+++ b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala | |
@@ -381,4 +381,41 @@ class FutureSpec extends JUnitSuite { | |
assert(dataflowVar2() === 5) | |
assert(dataflowVar.get === 5) | |
} | |
+ | |
+ @Test def futureComposingWithContinuations { |