Created
August 29, 2012 21:05
-
-
Save RayRoestenburg/3518957 to your computer and use it in GitHub Desktop.
WireTap
This file contains 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
/** | |
* A trait to wire tap every message that is processed by an Actor | |
* A listener is sent every message that the actor received, after | |
* the actor has processed it. | |
*/ | |
trait WireTap extends Actor { | |
def listener: ActorRef | |
abstract override def receive = { | |
case m => | |
super.receive(m) | |
listener ! m | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment