W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2009

Re: Alternative File API

From: Nikunj R. Mehta <nikunj.mehta@oracle.com>
Date: Tue, 18 Aug 2009 15:00:25 -0700
Cc: arun@mozilla.com, Jonas Sicking <jonas@sicking.cc>, Webapps WG <public-webapps@w3.org>
Message-Id: <0B183B20-60BF-462F-9255-EF51F6BD9741@oracle.com>
To: Olli Pettay <Olli.Pettay@helsinki.fi>
Please don't snip the context. If I say something in the context of  
what someone else was stating, the context is important for discussion.

On Aug 18, 2009, at 2:39 PM, Olli Pettay wrote:

> On 8/18/09 11:08 PM, Nikunj R. Mehta wrote:
>> Do we need asynchronous APIs if files are local and file system  
>> access
>> is fast?
> Files that you select from file system aren't necessarily local and
> the system access can be very slow in some cases.
> I use sshfs all the time to mount remote systems to local file system.
> NFS is pretty common everywhere.

I am not pretending that I don't understand networked filesystems.  
However, Arun, in his original message, was alluding to your "pretty  
common" case as a "desirable edge" case. I suppose you are not in  
agreement with his classification then.

>
>> If we do, then why do we not also need progress events? I don't
>> quite follow your reasoning and classification of "desirable edge  
>> case".
>> It seems that the whole WebApps WG has accepted the "desirable edge
>> case" of dealing with system delays such as in SQL databases and file
>> systems through the use of asynchronous APIs.
> There are cases like (the example is about XHR) http://www.bluishcoder.co.nz/2009/06/reading-ogg-files-with-javascript.html
> where one wants to load a huge file and process it while still loading
> the file.

Not sure how I should interpret your answer in the context of my  
question. As I understand it, you want to see blocks of data read from  
the file so that you can incrementally process the data received. This  
is pretty much the same programming model one would have on the  
server, where events are rarely used to access file blocks. That is  
what I am getting at with my next sentence.

>
>> Honestly, I don't like to use events for file access.
> Why not? To me the difference between callbacks and events isn't that
> big, but with events supporting progress events becomes possible.
> (I wouldn't want to see different progress tracking for XHR and File  
> reading).


Progress tracking is not the same as incremental processing although  
you could employ the former to do the latter. However, that forces  
everyone to think of the arrival of data as an event, and that is  
likely to be unacceptable to some.

Nikunj
http://o-micron.blogspot.com
Received on Tuesday, 18 August 2009 22:03:55 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:33 GMT