I don't quite a good Scala programmer and need some help with understanding syntax. Here is the trait I am struggling with:
trait ActorTracing extends AroundReceiveOverrideHack { self: Actor =>
protected def serviceName: String =
this.getClass.getSimpleName
implicit def any2response[T](msg: T): ResponseTracingSupport[T] =
new ResponseTracingSupport(msg)
implicit lazy val trace: TracingExtensionImpl =
TracingExtension(context.system)
override protected final def aroundReceiveInt(receive: Receive, msg: Any): Unit =
msg match {
case ts: BaseTracingSupport if receive.isDefinedAt(msg) =>
trace.start(ts, serviceName)
case _ =>
}
}
It seems that the traits' body starts with Function1
literal. self:Actor =>
... What would it mean here in this example?