Created
September 17, 2012 15:33
-
-
Save derekjw/3738032 to your computer and use it in GitHub Desktop.
Akka Eventstream fix
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
--- /home/derek/Development/Projects/akka/akka-actor/src/main/scala/akka/util/SubclassifiedIndex.scala 2012-09-17 09:25:41.807104726 -0600 | |
+++ SubclassifiedIndex.scala 2012-09-01 11:43:45.906813283 -0600 | |
@@ -79,14 +78,16 @@ | |
* Add key to this index which inherits its value set from the most specific | |
* super-class which is known. | |
*/ | |
- def addKey(key: K): Changes = | |
- subkeys collectFirst { | |
+ def addKey(key: K): Changes = { | |
+ val ch = subkeys collect { | |
case n if sc.isEqual(n.key, key) ⇒ Nil | |
case n if sc.isSubclass(key, n.key) ⇒ n.addKey(key) | |
- } getOrElse { | |
+ } | |
+ if (ch.isEmpty) { | |
integrate(new Nonroot(key, values)) | |
List((key, values)) | |
- } | |
+ } else ch.flatten | |
+ } | |
/** | |
* Add value to all keys which are subclasses of the given key. If the 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
private def updateCache(diff: Seq[(Classifier, Set[Subscriber])]): Boolean = | |
if (diff.isEmpty) false | |
else { | |
subscriptions.synchronized { | |
_cache ++= (diff groupBy (_._1) mapValues (kvs => (kvs.head._2 /: kvs.tail)(_ ++ _._2))) | |
} | |
true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment