enqueueChain
Enqueues a TaskChain for sequential execution.
Each step executes only after the previous one succeeds. Step progress is persisted so chains resume correctly after app termination.
Observe chain-level states via observeChain:
kmpWorker.enqueueChain(chain)
kmpWorker.observeChain(chain.id).collect { state ->
when (state) {
is TaskState.Success -> println("Chain complete!")
is TaskState.Failed -> println("Chain failed at step: ${state.throwable.message}")
else -> {}
}
}Content copied to clipboard
Enqueues a TaskChain with a ChainPolicy to handle duplicate chain IDs.