Skip to content

feat: support concurrency limit - #542

Open
thep0y wants to merge 3 commits into
react-component:masterfrom
thep0y:master
Open

feat: support concurrency limit#542
thep0y wants to merge 3 commits into
react-component:masterfrom
thep0y:master

Conversation

@thep0y

Copy link
Copy Markdown

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.
@vercel

vercelBot commented Jan 13, 2024

Copy link
Copy Markdown

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

NameStatusPreviewCommentsUpdated (UTC)
upload✅ Ready (Inspect)Visit Preview💬 Add feedbackJan 14, 2024 4:14am

@codecov

codecovBot commented Jan 13, 2024

Copy link
Copy Markdown

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 22 commits behind head on master.

Files with missing linesPatch %Lines
src/concurrencyRequest.ts0.00%44 Missing ⚠️
src/AjaxUploader.tsx66.66%3 Missing ⚠️
src/request.ts91.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
Copy Markdown
Member

覆盖率得想办法补一下。

@thep0y

Copy link
Copy Markdown
Author

覆盖率得想办法补一下。

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

@afc163

Copy link
Copy Markdown
Member

@afc163

Copy link
Copy Markdown
Member

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

@narimanshariat

Copy link
Copy Markdown

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

Sign up for freeto 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

@thep0y@afc163@narimanshariat