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

feat: fetch use concurrency #22

Merged
merged 3 commits into from
May 15, 2022
Merged

feat: fetch use concurrency #22

merged 3 commits into from
May 15, 2022

Conversation

nonzzz
Copy link
Collaborator

@nonzzz nonzzz commented May 9, 2022

Background

Description

  • Modify Fetch behavior when user enter a nonexistent registry alias.
  • It's ready

Others

In past. We only use one goroutine. In main process. But when we use grm test command. We can found the speed don't ideal. So we should speed up the program with goroutine. According my thoughts. I should mock a func just like in javaScript Promise.All to done this work.

Why Promise.All. Because we should guarantee the order of the output.

@nonzzz nonzzz requested a review from zaunist May 9, 2022 04:08
@nonzzz nonzzz self-assigned this May 9, 2022
@nonzzz
Copy link
Collaborator Author

nonzzz commented May 9, 2022

Don't merge this Pr. Unless I done the second task.

@codecov-commenter
Copy link

codecov-commenter commented May 9, 2022

Codecov Report

Merging #22 (d7d93bf) into master (58ed196) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #22   +/-   ##
=======================================
  Coverage   75.00%   75.00%           
=======================================
  Files           2        2           
  Lines          20       20           
=======================================
  Hits           15       15           
  Misses          4        4           
  Partials        1        1           
Flag Coverage Δ
unittests 75.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@zaunist zaunist left a comment

Choose a reason for hiding this comment

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

LGTM

@nonzzz
Copy link
Collaborator Author

nonzzz commented May 15, 2022

@zaunist cc.

@nonzzz
Copy link
Collaborator Author

nonzzz commented May 15, 2022

I decide use unbuffered channel. Becasue i think send and accept should be separated, this is why i don't use buffered channel to do. You can view the code. we limit the goroutine queue number.

@zaunist
Copy link
Member

zaunist commented May 15, 2022

/LGTM

@nonzzz nonzzz merged commit 3f4e0f8 into modern-magic:master May 15, 2022
@nonzzz nonzzz deleted the perf/fetch branch May 15, 2022 10:31
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