Skip to content

Conversation

@eqimd
Copy link
Member

@eqimd eqimd commented Sep 28, 2023

No description provided.

var startPage = new Page(startPageTitle, null);

var res = processPage(startPage, endPageTitle, 0, maxDepth, visitedPages, executor);
if (res.isEmpty()) {
Copy link

Choose a reason for hiding this comment

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

orElseThrow )

});
});

for (int i = 0; i < links.size(); i++) {
Copy link

Choose a reason for hiding this comment

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

I would use StructuredConcurrency for this (https://www.youtube.com/watch?v=2nOj8MKHvmw&t=1972s)

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. By the way, how can I reach the same logic with Kotlin Coroutines? I could not find something like awaitFirst for async deferred's, only awaitAll. I also could not find something like coroutineScope.result

List<CompletableFuture<Void>> futures = new ArrayList<>();

do {
for (int i = 0; i < 10; i++) {
Copy link

Choose a reason for hiding this comment

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

why 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.

5 participants