1 - triagedhelp wantedt:cluster-tools
描述
Hi,
Not sure if such proposal will find support here, but it would be nice to have (at least basic) wildcard support in DistributedPubSubMediator, similar to what is provided by actorSelection. Consider following simple modification:
def publish(path: String, msg: Any, allButSelf: Boolean = false): Unit = {
val pattern = Helpers.makePattern(path)
for {
(address, bucket) <- registry
if !(allButSelf && address == selfAddress) // if we should skip sender() node and current address == self address => skip
valueHolder <- bucket.content.filterKeys(k => pattern.matcher(k).matches).values
ref <- valueHolder.ref
} ref forward msg
}
This would allow to do something like:
mediator ! SendToAll("/user/parent/foo:bar:*", "Hello World", false)
I'm new to Akka/Scala and not sure if I can provide a production-quality pull request, but at least I'm showing the basic idea and a straightforward implementation. I hope similar functionality could be included in Akka, to make it even more powerful :relaxed: