SHARE
TWEET

Untitled

a guest Oct 21st, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. trait Log extends Sender {
  2.  abstract override def send(event: ServingError): Unit = {
  3.    Logger.log(event.description)
  4.    super.send(event)
  5.  }
  6. }
  7. trait Metric extends Sender {
  8.  abstract override def send(event: ServingError): Unit = {
  9.    Monitor.incrementCounter(event.getClass.getSimpleName, "errorCode" -> event.code.toString)
  10.    super.send(event)
  11.  }
  12. }
  13. trait S3_Backup extends Sender {
  14.  abstract override def send(event: ServingError): Unit = {
  15.    S3_Client.upload(event.content)
  16.    super.send(event)
  17.  }
  18. }
  19. trait Kafka extends Sender {
  20.  abstract override def send(event: ServingError): Unit = {
  21.    Try(KafkaProducer.send(event.content)).getOrElse(super.send(event))
  22.  }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top