ZipZap icon indicating copy to clipboard operation
ZipZap copied to clipboard

Does zipzap support progress callback?

Open xmkevinchen opened this issue 10 years ago • 7 comments

Hey guys,

Does zipzap or will support the progress callback via delegate, block or something?

It would be OK for UI

Thanks

xmkevinchen avatar Apr 01 '14 10:04 xmkevinchen

We currently don't report progress, as zipzap is a synchronous API. It doesn't use threads or other asynchronous methods beneath the surface, and all work is done when the call returns. This generally makes it easier to reason about.

That being said, the API will work from a different, non-UI thread provided the objects are created and used in that thread. Thus it does make sense to implement a progress callback -- did you only want a callback for -[ZZMutableArchive updateEntries:error:]? Can you limit this to iOS 7 or OS X 10.9 and later, I can use NSProgress then?

pixelglow avatar Apr 04 '14 05:04 pixelglow

I can’t limit the usage only for iOS 7 and OS X 10.9 now,

Do you have a plan that make thing done?

Best Regards,

Kevin Chen

On Apr 4, 2014, at 1:56 PM, Glen Low [email protected] wrote:

We currently don't report progress, as zipzap is a synchronous API. It doesn't use threads or other asynchronous methods beneath the surface, and all work is done when the call returns.

That being said, the API will work from a different, non-UI thread provided the objects are created and used in that thread. Thus it does make sense to implement a progress callback -- did you only want a callback for -[ZZMutableArchive updateEntries:error:]? Can you limit this to iOS 7 or OS X 10.9 and later, I can use NSProgress then?

— Reply to this email directly or view it on GitHub.

xmkevinchen avatar Apr 07 '14 01:04 xmkevinchen

I had a good look at NSProgress and since the API is so compelling and likely to be well-supported by Apple and third parties going forward, it is likely we will use that API instead of any custom callback scheme. Thus the official client will offer progress callback via NSProgress when built for iOS 7 and OS X 10.9.

If you cannot limit usage to iOS 7 and OS X 10.9, you can write a minimal NSProgress shim to get this functionality. Let me know what you think.

pixelglow avatar Apr 11 '14 00:04 pixelglow

@pixelglow do you have any recommendations/best practices for reading (extracting) a ZZArchive asynchronously?

Obviously I could just use GCD. Just wondering your thoughts.

RLovelett avatar Oct 19 '15 15:10 RLovelett

@RLovelett please raise a new issue for this, thanks.

pixelglow avatar Oct 19 '15 23:10 pixelglow

@pixelglow , have you already implemented the progress callback now? -[ZZMutableArchive updateEntries:error:] cannot be used for NSProgress

jimwan avatar Feb 07 '17 07:02 jimwan

@pixelglow Also wondering if NSProgress is implemented? I didn't see it in the API.

robbiehanson avatar Mar 14 '18 21:03 robbiehanson