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

jp.co.bizreach.elasticsearch4s.retry.BackOff.scala Maven / Gradle / Ivy

The newest version!
package jp.co.bizreach.elasticsearch4s.retry

sealed trait BackOff extends java.io.Serializable {
  def nextDuration(count: Int, duration: Long): Long
}

object LinerBackOff extends BackOff {
  override def nextDuration(count: Int, duration: Long): Long = duration * count
}

object ExponentialBackOff extends BackOff {
  override def nextDuration(count: Int, duration: Long): Long = duration ^ count
}

object FixedBackOff extends BackOff {
  override def nextDuration(count: Int, duration: Long): Long = duration
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy