Cancel a Task

To stop a task that is in progress, use the cancelTask() method to stop all processing of the task. DT does not provide any notifications on task cancellations.

Kotlin
fun cancelTask(
taskId: String,
metadata: Bundle = Bundle()
)
PARAMETER
STATUS
TYPE
DESCRIPTION

taskId

Required

String

Unique ID for the task you want to cancel. DT assigns a task ID to every task. Obtain the task ID from either a callback or broadcast about the task in progress.

metadata

Optional

Bundle

Additional metadata to pass to Ignite.

Example

Kotlin
// Initialization

// Specify task id received previously in broadcast or callbacks onScheduled() method

IgniteServiceSdk.instance().cancelTask(taskId)
// ...

Last updated