KmpWorkerConfig

data class KmpWorkerConfig(val maxRetries: Int = 10, val logLevel: KmpWorkerLogger.Level = KmpWorkerLogger.Level.INFO, val logger: KmpWorkerLogger.Logger? = null, val taskTimeout: Duration? = null)

Global configuration for KMPWorker behaviour.

Configure once during app startup before any tasks are enqueued:

KmpWorkerConfig.configure {
maxRetries = 5
logLevel = KmpWorkerLogger.Level.DEBUG
logger = KmpWorkerLogger.Logger { level, msg, t ->
println("[$level] $msg")
}
}

Constructors

Link copied to clipboard
constructor(maxRetries: Int = 10, logLevel: KmpWorkerLogger.Level = KmpWorkerLogger.Level.INFO, logger: KmpWorkerLogger.Logger? = null, taskTimeout: Duration? = null)

Types

Link copied to clipboard
class Builder(base: KmpWorkerConfig = KmpWorkerConfig())
Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Optional custom logger. If null, all log output is suppressed.

Link copied to clipboard

Minimum log level to emit. Defaults to KmpWorkerLogger.Level.INFO. Set to KmpWorkerLogger.Level.DEBUG during development.

Link copied to clipboard
val maxRetries: Int = 10

Global maximum number of retry attempts for RetryPolicy.Exponential. Individual task policies override this if they set their own RetryPolicy.Exponential.maxRetries.

Link copied to clipboard
val taskTimeout: Duration? = null

Maximum wall-clock time a single task execution may run before it is automatically cancelled and reported as TaskState.TimedOut.