Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TaskId? #5

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

add TaskId? #5

wants to merge 1 commit into from

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