英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论