Created
June 10, 2018 13:42
-
-
Save adamw/86bf777ad1341ef03deb89ca6815cbe9 to your computer and use it in GitHub Desktop.
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
class BroadcastActor(connector: QueueConnector[Future]) | |
extends Actor with ActorLogging { | |
private var consumers: Set[ActorRef] = Set() | |
override def receive: Receive = { | |
case Subscribe(actor) => consumers += actor | |
case Received(msg) => | |
consumers.foreach(_ ! msg) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment