cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gauthier <m...@silverorange.com>
Subject Re: File plugin threading on iOS
Date Wed, 11 Dec 2013 13:59:20 GMT

On 2013-12-10 18:10, Ian Clelland wrote:
> On Tue, Dec 10, 2013 at 4:40 PM, Michael Gauthier <mike@silverorange.com>wrote:
>
>> I quickly updated the File plugin to do the local file uri stuff in
>> resolveLocalFileSystemURI in the background using [self.commandDelegate
>> runInBackground:^{}].
>>
>
> Dev or master?
>
I made the change in master. Dev looks way awesomer. When do you think 
you will release?


>
>>
>> It works and allows my app interface to respond while the FS calls are
>> resolving. Is this approach crazy or obviously broken in some way?
>>
>
> Probably not crazy -- depending on how you've implemented it :) It's
> basically what I'm doing in my branch as well.
>
> Currently, I have CDVFile using that pattern, [self.commandDelegate
> runInBackground:], to call the actual implementation method in
> CDVLocalFilesystem or CDVAssetLibraryFilesystem. CDVFile passes the
> implementation methods a callback function that sends the actual plugin
> response when the operation is finished. (Keeping all of the
> "Cordova-plugin-y" bits in CDVFile, and just having the raw file operations
> in the file system implementation classes.
>
> You can see an example of what I've done in the implementation of [CDVFile
> readAsText:] and in [CDVLocalFilesystem readFileAtURL:start:end:callback:]
> in the dev branch.
>
> Ian
>


Mime
View raw message