-
Notifications
You must be signed in to change notification settings - Fork 35
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
issue #61 #69
issue #61 #69
Conversation
@tmjee I will find a reviewer for your pull requests shortly, thanks for contribution! |
@longtimeago could you please review this pull request |
} .call(); | ||
}; | ||
final ExecutorService executorService = Executors.newFixedThreadPool(5); | ||
for (int count = zero; count < fifty; count = count + 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmjee It's better to create all Callable instances ant then submit them via ExecutorService#invokeAll()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@longtimeago if we do
for (...) {
callables.add(
new Callable<..>(){...};
)
}
executor.invokeAll(callables);
we'll get checkstyle warnings AvoidInstantiating objectsInLoops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmjee well ... Agreed ... as our Callable has no state we can reuse it many time
@tmjee please, see several remarks above |
@longtimeago done. |
executorService.submit(callable); | ||
} | ||
executorService.shutdown(); | ||
executorService.awaitTermination(tentimes, TimeUnit.SECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmjee Hereinafter, awaitTermination
returns true
if all tasks are finished successfully in given time.
As I said in on of my comments, we should assert that awaitTermination
returns true
and fail overwise.
MatcherAssert.assertThat(executorService.awaitTermination(tentimes, TimeUnit.SECONDS), Matchers.is(true));
@tmjee And one more round, we are very close to finish :) |
@longtimeago done. |
for (int count = zero; count < ten; count = count + 1) { | ||
executorService.submit(callable); | ||
} | ||
executorService.awaitTermination(ten, TimeUnit.SECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmjee what about proper shutdown sequence here?
for (int count = zero; count < fifty; count = count + 1) { | ||
executorService.submit(runnable); | ||
} | ||
executorService.awaitTermination(ten, TimeUnit.SECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmjee and here
@tmjee please, be more attentive. Several more remarks |
@longtimeago done |
@tmjee and one more |
@tmjee now it's good. Thank you! |
@rultor merge |
@longtimeago Thanks for your request. @yegor256 Please confirm this. |
@rultor try to merge |
@tmjee what happened with the fork? you deleted it? we can't merge |
@tmjee not a problem. Please, close this one. |
@longtimeago Thanks for your contribution, 22 mins was added to your account, payment ID is |
Fix issue #61 Get rid of AspectJ