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")
}
}Content copied to clipboard
Constructors
Link copied to clipboard
constructor(maxRetries: Int = 10, logLevel: KmpWorkerLogger.Level = KmpWorkerLogger.Level.INFO, logger: KmpWorkerLogger.Logger? = null, taskTimeout: Duration? = null)
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
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
Maximum wall-clock time a single task execution may run before it is automatically cancelled and reported as TaskState.TimedOut.