All Downloads are FREE. Search and download functionalities are using the official Maven repository.

skinny.worker.SkinnyWorker.scala Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package skinny.worker

import skinny.logging.LoggerProvider

trait SkinnyWorker extends Runnable with LoggerProvider {

  def execute(): Unit

  def run(): Unit = {
    try execute()
    catch { case t: Throwable => handle(t) }
  }

  def handle(t: Throwable): Unit = {
    logger.error(s"Failed to run ${this.getClass.getCanonicalName} because ${t.getMessage}", t)
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy