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 TPS for all async items #22

Closed
wants to merge 5 commits into from

Conversation

acarbonetto
Copy link

No description provided.

tasks.stream().map(CompletableFuture::runAsync).collect(Collectors.toList());
try {
// wait 1 second before waiting for threads to complete
Thread.sleep(1000);

Choose a reason for hiding this comment

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

Why do we need to wait 1 second here?

Copy link
Author

Choose a reason for hiding this comment

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

because we want to give the tasks.stream().map(CompletableFuture::runAsync).collect a chance to finish starting tasks and we want to executors to start working on those tasks. Otherwise, the thread manager may start to give some cycles to the wait calls below.

@Yury-Fridlyand
Copy link

TPS was implemented in #10

@acarbonetto acarbonetto deleted the java-client/add_tps branch December 19, 2023 22:24
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.

3 participants