cancel

suspend fun cancel(taskId: String, reason: String = "")

Emits TaskState.Cancelled for the given task ID and removes any stored events.