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

[UDD-35] Concurrent Document Extraction Eexample #255

Merged

Conversation

kellemNegasi
Copy link
Contributor

No description provided.

@kellemNegasi kellemNegasi marked this pull request as ready for review June 11, 2024 10:01
@kellemNegasi kellemNegasi changed the title [UDD-35] Concurrent Document ExtractionEexample [UDD-35] Concurrent Document Extraction Eexample Jun 11, 2024
Copy link
Contributor

@3ace 3ace left a comment

Choose a reason for hiding this comment

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

Please add README.md file for this new folder. You could see other folders for example

concurrent-processing/concurrent_extraction.go Outdated Show resolved Hide resolved
@kellemNegasi kellemNegasi requested a review from 3ace June 11, 2024 10:38
Copy link
Contributor

@sampila sampila left a comment

Choose a reason for hiding this comment

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

added a comment


// runConcurrent takes the list of input documents and destination output directory and runs the extraction concurrently.
func runConcurrent(documents []string, outputDir string) {
res := make(chan map[string]string, 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this same as document length? like

res := make(chan map[string]string, len(documents))

Copy link
Contributor Author

@kellemNegasi kellemNegasi Jun 11, 2024

Choose a reason for hiding this comment

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

Not necessarily. If we are reading as soon as the go routines are writting to the channel a buffer length of 1 is still enough but I made it 3 just to be safe. I think may be i should increase that in case reading side is very slow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sampila Updated. Can you check again?

Copy link
Contributor

@sampila sampila left a comment

Choose a reason for hiding this comment

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

Looks good to me

@sampila sampila merged commit 227d174 into unidoc:master Jun 11, 2024
6 checks passed
@kellemNegasi kellemNegasi deleted the udd-35-concurrent-extraction-example branch June 11, 2024 17:47
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