Skip to content

Instantly share code, notes, and snippets.

@RayRoestenburg
Created August 29, 2012 20:17
Show Gist options
  • Save RayRoestenburg/3518294 to your computer and use it in GitHub Desktop.
Save RayRoestenburg/3518294 to your computer and use it in GitHub Desktop.
A node trait
trait Node { actor:Actor =>
def send(actorRef:ActorRef, m:Any) { actorRef.tell(m) }
def reply(m:Any) { sender ! m }
def forward(actorRef:ActorRef, m:Any) { actorRef.forward(m) }
def actorOf(props:Props):ActorRef = actor.context.actorOf(props)
def actorFor(actorPath:ActorPath):ActorRef = actor.context.actorFor(actorPath)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment