SHARE
TWEET

Untitled

a guest Oct 21st, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. abstract class Sender {
  2.  def send(event: ServingError): Unit
  3. }
  4. trait Log extends Sender {
  5.  override def send(event: ServingError): Unit = {
  6.    Logger.log(event.description)
  7.  }
  8. }
  9. trait Metric extends Sender {
  10.  override def send(event: ServingError): Unit = {
  11.    Monitor.incrementCounter(event.getClass.getSimpleName/*this is not recommended...*/, "errorCode" ->
  12.    event.code.toString)
  13.  }
  14. }
  15. trait S3_Backup extends Sender {
  16.  override def send(event: ServingError): Unit = {
  17.    S3_Client.upload(event.content)
  18.  }
  19. }
  20. trait Kafka extends Sender {
  21.  def send(event: ServingError): Unit = {
  22.    KafkaProducer.send(event.content) }
  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