Target filter
Search Kotlin docs
  • Platforms
  • Tealium Prism Kotlin
core/com.tealium.prism.core.api.network/CooldownHelper

CooldownHelper

class CooldownHelper

A helper class to keep track of a cooldown period based on errors occurring.

Parameters

maxInterval

The maximum amount of time a cooldown period can last.

errorBaseInterval

The amount of time to extend the cooldown for each consecutive failure, limited by the maxInterval

status

Defaults to CooldownStatus.Success, but this is typically only used for testing.

timingProvider

Provider function to provide the current time

Types

Companion
Link copied to clipboard
object Companion
CooldownStatus
Link copied to clipboard
enum CooldownStatus : Enum<CooldownHelper.CooldownStatus>

The CooldownStatus describes the result of a previous event.

Properties

errorBaseInterval
Link copied to clipboard
val errorBaseInterval: TimeFrame
failureCount
Link copied to clipboard
var failureCount: Int

Gets the number of consecutive CooldownStatus.Failures that have been reported.

maxInterval
Link copied to clipboard
var maxInterval: TimeFrame
status
Link copied to clipboard
var status: CooldownHelper.CooldownStatus

Gets the current CooldownStatus of this CooldownHelper

Functions

isInCooldown
Link copied to clipboard
fun isInCooldown(lastFetch: Long): Boolean

Determines whether or not the Cooldown period, if currently in one, has elapsed.

updateStatus
Link copied to clipboard
fun updateStatus(status: CooldownHelper.CooldownStatus)

Used to notify the CooldownHelper of the latest status.

Generated by Dokka
(c) Tealium 2026