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

[SR-8810] Encoder/Decoder should provide API for progress update #3633

Open
BenchR267 opened this issue Sep 20, 2018 · 0 comments
Open

[SR-8810] Encoder/Decoder should provide API for progress update #3633

BenchR267 opened this issue Sep 20, 2018 · 0 comments

Comments

@BenchR267
Copy link
Member

Previous ID SR-8810
Radar rdar://problem/44645862
Original Reporter @BenchR267
Type Improvement
Environment

Swift 4.2

Additional Detail from JIRA
Votes 1
Component/s Foundation
Labels Improvement
Assignee None
Priority Medium

md5: b1b3ac88e51258a488668c23b049a4ef

Issue Description:

When encoding/decoding very big objects or arrays, it can take some time. In clients (UI or CLI apps) it would be reasonable to show a progress indicator for long running tasks like that.
Since JSON(De|En)coder and PropertyList(De|En)coder are both in Foundation, this API could make use of the Progress API in Foundation. But it could also just be a closure which is called with the progress in percent.
I'm not sure how easy it is to calculate the actual progress though as JSON(De|En)coder are using JSONSerialization under the hood which is also not providing an API for progress updates. In theory it could be calculated by dividing the number of processed bytes by the (known) number of total bytes.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant