Skip to content

Instantly share code, notes, and snippets.

@richdougherty
Created November 5, 2014 22:20
Show Gist options
  • Save richdougherty/eccf477d711c35a9b96d to your computer and use it in GitHub Desktop.
Save richdougherty/eccf477d711c35a9b96d to your computer and use it in GitHub Desktop.
case class ReportInvalidJsonActorHolder(ref: ActorRef)
case class ReportUnhandledExceptionActorHolder(ref: ActorRef)
case class HeartbestProcessingActorHolder(ref: ActorRef)
case class DebugEmailActorHolder(ref: ActorRef)
object ReportInvalidJsonActor {
def props(debugEmailActorHolder: DebugEmailActorHolder) =
Props(classOf[ReportInvalidJsonActor], debugEmailActorHolder)
case class InvalidJsonMessage(content : String, exceptionMessage: String)
}
class ReportInvalidJsonActor(debugEmailActorHolder: DebugEmailActorHolder) extends Actor {
override def receive = {
case m : InvalidJsonMessage => debugEmailActorHolder.ref ! DebugEmailActor.EmailMessage(...)
}}
@Singleton
class ReportInvalidJsonActorProvider @Inject() (
system: ActorSystem,
debugEmailActorHolder: DebugEmailActorHolder) extends Provider[ReportInvalidJsonActorHolder] {
def get: ActorRef = {
val ref = system.actorOf(ReportInvalidJsonActor.props(debugEmailActorHolder), "report-invalid-json")
ReportInvalidJsonActorHolder(ref)
}
}
@huntc
Copy link

huntc commented Nov 5, 2014

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment