watchUrl

fun watchUrl(url: URL, period: Long = 5, unit: TimeUnit = TimeUnit.SECONDS, context: CoroutineContext = Dispatchers.Default, optional: Boolean = this.optional, onLoad: (config: Config, source: Source) -> Unit? = null): Config

Returns a child config containing values from specified url, and reloads values periodically.

Return

a child config containing values from specified url

Parameters

url

specified url

period

reload period. The default value is 5.

unit

time unit of reload period. The default value is TimeUnit.SECONDS.

context

context of the coroutine. The default value is Dispatchers.Default.

optional

whether the source is optional

onLoad

function invoked after the updated URL is loaded

fun watchUrl(url: String, period: Long = 5, unit: TimeUnit = TimeUnit.SECONDS, context: CoroutineContext = Dispatchers.Default, optional: Boolean = this.optional, onLoad: (config: Config, source: Source) -> Unit? = null): Config

Returns a child config containing values from specified url string, and reloads values periodically.

Return

a child config containing values from specified url string

Parameters

url

specified url string

period

reload period. The default value is 5.

unit

time unit of reload period. The default value is TimeUnit.SECONDS.

context

context of the coroutine. The default value is Dispatchers.Default.

optional

whether the source is optional

onLoad

function invoked after the updated URL is loaded