My acc-learn-o-thon streams go on. I would like to integrate akka-streams application with akka-cluster and DistributedPubSubMediator .
Adding support for publishing is pretty straight forward, but I’m having problems in the "Subscription" section.
For reference, the subscriber is listed below in Sampleafe :
class ChatClient(name: String) extends Actor {
val mediator = DistributedPubSub(context.system).mediator
mediator ! Subscribe("some topic", self)
def receive = {
case ChatClient.Message(from, text) =>
...process message...
}
}
My question is: how can I integrate this actor with my stream, and how should I guarantee that I receive public messages in the absence of backpressure of the stream?
I am trying to run a pubsub model where one thread can post a message and another thread will consume it (if it is signed).