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: support concurrency limit #542

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

thep0y
Copy link

@thep0y thep0y commented Jan 13, 2024

When enabling multi-file upload, you can control the concurrency by providing the concurrencyLimit property.

The concurrencyLimit property creates a ConcurrencyRequester instance, storing all requests in the instance's queue. The concurrent upload task quantity is restricted by the concurrencyLimit when using the send method of the instance at the end of the uploadFiles process.

When enabling multi-file upload, you can control the concurrency by providing the `concurrencyLimit` property.

The `concurrencyLimit` property creates a `ConcurrencyRequester` instance, storing all requests in the instance's queue. The concurrent upload task quantity is restricted by the `concurrencyLimit` when using the `send` method of the instance at the end of the `uploadFiles` process.
Copy link

vercel bot commented Jan 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
upload ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2024 4:14am

Copy link

codecov bot commented Jan 13, 2024

Codecov Report

Attention: Patch coverage is 36.36364% with 49 lines in your changes missing coverage. Please review.

Project coverage is 75.07%. Comparing base (6027d4c) to head (89f3d6b).
Report is 2 commits behind head on master.

Files Patch % Lines
src/concurrencyRequest.ts 0.00% 44 Missing ⚠️
src/AjaxUploader.tsx 66.66% 3 Missing ⚠️
src/request.ts 91.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #542       +/-   ##
===========================================
- Coverage   87.21%   75.07%   -12.15%     
===========================================
  Files           6        7        +1     
  Lines         266      325       +59     
  Branches       72       79        +7     
===========================================
+ Hits          232      244       +12     
- Misses         34       81       +47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- Use type imports in concurrencyRequest.ts for better clarity.
- Extract XHR load event handling into a separate function, onXHRLoad, in request.ts.
- Update references to onXHRLoad in both concurrencyRequest.ts and request.ts.
@afc163
Copy link
Member

afc163 commented Jan 18, 2024

覆盖率得想办法补一下。

@thep0y
Copy link
Author

thep0y commented Jan 18, 2024

覆盖率得想办法补一下。

试过了,并发请求的测试实再不知道怎么写

@afc163
Copy link
Member

afc163 commented Feb 18, 2024

ref ant-design/ant-design#28950

@afc163
Copy link
Member

afc163 commented Feb 18, 2024

@zombieJ 这个的用例来帮忙补一下?

@narimanshariat
Copy link

This could be a useful feature to control browser resource usage with batch file uploads. Any chance this would be merged?

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