初始延迟在链接中的计数是如何工作的?

huangapple go评论67阅读模式
英文:

How initial delay counting in chaining works?

问题

initialDelay 在这种情况下何时开始计时:每个请求都有独立的延迟,还是共用一个延迟?

val triggerRequests = triggers.map {
    OneTimeWorkRequestBuilder<TriggerWorker>()
        .setInitialDelay(5000, TimeUnit.MILLISECONDS)
        .build()
}


var workContinuation = workManager.beginWith(triggerRequests[0])
triggerRequests.subList(1, triggerRequests.size).forEach() {
    workContinuation = workContinuation.then(it)
}
workContinuation.enqueue()
英文:

When initialDelay will start counting in this case: individual for each request or common?

val triggerRequests = triggers.map {
    OneTimeWorkRequestBuilder<TriggerWorker>()
        .setInitialDelay(5000, TimeUnit.MILLISECONDS)
        .build()
}


var workContinuation = workManager.beginWith(triggerRequests[0])
triggerRequests.subList(1, triggerRequests.size).forEach() {
    workContinuation = workContinuation.then(it)
}
workContinuation.enqueue()

答案1

得分: 1

会在第一次启动时运行,但不会包括在接下来的启动中。

英文:

It will work for the first startup. will not be included in the next.

huangapple
  • 本文由 发表于 2023年5月20日 23:32:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76295990.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定