Skip to content

Commit 7ddbe07

Browse files
committed
Fix
1 parent decd597 commit 7ddbe07

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/com/thealgorithms/scheduling/SpeculativeExecutionScheduling.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,23 @@ public SpeculativeExecutionScheduling() {
3636
taskGroups = new HashMap<>();
3737
}
3838

39+
/**
40+
* Adds a task to the specified group.
41+
*
42+
* @param groupName the name of the group
43+
* @param taskName the name of the task
44+
*/
3945
public void addTask(String groupName, String taskName) {
4046
taskGroups.putIfAbsent(groupName, new ArrayList<>());
4147
taskGroups.get(groupName).add(new Task(taskName));
4248
}
4349

50+
/**
51+
* Executes the tasks in the specified group.
52+
*
53+
* @param groupName the name of the group
54+
* @return the name of the task that completed successfully
55+
*/
4456
public String executeTasks(String groupName) {
4557
List<Task> tasks = taskGroups.get(groupName);
4658
if (tasks == null) {

0 commit comments

Comments
 (0)