isFinished

infix fun isFinished(isTaskFinished: Function<Task, Boolean>): DynamicTask
fun isFinished(isTaskFinished: BooleanSupplier, ktCompatUnusedIgnore: Any? = null): DynamicTask

Returning true will end the task.