aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/kamon/actor/AskSupport.scala
blob: 8a1ac2e8ba623a13b5d123fb1f01e4115ec7d089 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package kamon.actor

import akka.actor.ActorRef
import akka.util.Timeout
import kamon.TraceContext

trait TraceableAskSupport {
  implicit def pimpWithTraceableAsk(actorRef: ActorRef) = new TraceableAskableActorRef(actorRef)
}

// FIXME: This name sucks
class TraceableAskableActorRef(val actorRef: ActorRef) {

  def ??(message: Any)(implicit timeout: Timeout) = akka.pattern.ask(actorRef, TraceableMessage(TraceContext.current.get().fork, message))

}