Skip to content

Conversation

@dkaznacheev
Copy link
Owner

No description provided.

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>

Choose a reason for hiding this comment

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

В чем смысл хранения .idea в репозитории для гредл проекта? Пока -2

private void compute() {
try {
result = supplier.get();
} catch (Exception e) {

Choose a reason for hiding this comment

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

Почему именно Exception, а не Throwable?

*/
@Override
public <U> LightFuture<U> thenApply(Function<T, U> function) {
return addTask(() -> function.apply(get()));

Choose a reason for hiding this comment

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

" Метод thenApply не должен блокировать работу потока, если результат задачи X ещё не вычислен", -1

Choose a reason for hiding this comment

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

Нужно добавить тест, который это проверяет

workers = new Thread[poolSize];

Runnable workerRunnable = () -> {
LightFutureImpl<?> future;

Choose a reason for hiding this comment

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

Я бы вынес тело Runnable в отдельный метод для улучшения читаемости

* Shuts down all of its current workers.
*/
@Override
public void shutdown() {

Choose a reason for hiding this comment

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

Мне кажется, метод shutdown должен завершаться только после завершения всех потоков. -1

}
}

public ThreadPoolImpl(int poolSize) {

Choose a reason for hiding this comment

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

Обычно поля и конструктор класса размещают в начале

@dzharkov
Copy link

Ок, 10/10

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