Package dev.deepcore.challenge.session
Class TaskGroup
java.lang.Object
dev.deepcore.challenge.session.TaskGroup
Tracks named tasks and guarantees replace/cancel behavior from one place.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCancels and removes the task currently mapped to the provided key.voidCancels all tracked tasks and clears the task map.voidReplaces any existing task for the key with the provided task instance.
-
Constructor Details
-
TaskGroup
public TaskGroup()
-
-
Method Details
-
replace
Replaces any existing task for the key with the provided task instance.- Parameters:
key- logical task keytask- task instance to store and manage
-
cancel
Cancels and removes the task currently mapped to the provided key.- Parameters:
key- logical task key to cancel
-
cancelAll
public void cancelAll()Cancels all tracked tasks and clears the task map.
-