Skip to content

Instantly share code, notes, and snippets.

@RayRoestenburg
Created August 29, 2012 21:05
Show Gist options
  • Save RayRoestenburg/3518957 to your computer and use it in GitHub Desktop.
Save RayRoestenburg/3518957 to your computer and use it in GitHub Desktop.
WireTap
/**
* 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