TaskChainBuilder

class TaskChainBuilder(chainId: String)

Fluent DSL builder for constructing TaskChains.

kmpWorker.chain("user-onboarding") {
beginWith("fetch-profile")
then("process-data") {
retryPolicy = RetryPolicy.Exponential(5_000, 3)
}
then("upload-results") {
constraints = Constraints(requiresInternet = true)
priority = TaskPriority.HIGH
}
}

Constructors

Link copied to clipboard
constructor(chainId: String)

Functions

Link copied to clipboard
fun beginWith(taskId: String, configure: TaskRequestBuilder.() -> Unit = {})

Adds the first step of the chain.

Link copied to clipboard
fun then(taskId: String, configure: TaskRequestBuilder.() -> Unit = {})

Adds a subsequent step that runs after all previous steps succeed.