Skip to content

add TaskId?#5

Draft
Anon8281 wants to merge 1 commit intomainfrom
dev
Draft

add TaskId?#5
Anon8281 wants to merge 1 commit intomainfrom
dev

Conversation

@Anon8281
Copy link
Owner

Need to think about it. May have some problems with OOM

@Anon8281 Anon8281 marked this pull request as ready for review September 27, 2023 13:28
@Anon8281 Anon8281 marked this pull request as draft September 27, 2023 13:28
});

tasksToRemove.forEach(tasks::remove);
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there is a more appropriate way


do {
taskId = new Random().nextInt();
} while (tasks.containsKey(taskId));
Copy link
Owner Author

@Anon8281 Anon8281 Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don’t use random, we will still be have to use brute force until we find a free task ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant