Re: Colliding FileWriters

2012-11-29 Thread Jan Varga
On Wed, Nov 28, 2012 at 4:10 PM, David Bruant wrote: > > >> One downside of this is that it means that if you're doing a bunch of > >> separate read/write operations in separate locks, each lock is held > >> until we've had a chance to fire the final success event for the > >> operation. So if you

Re: Colliding FileWriters

2012-11-28 Thread David Bruant
Hi, Sorry for the archaeologically late response. I'm currently documenting FileHandle and am trying to understand how it works, so I have a couple of questions. I don't think this particular message received a response and I have an unanswered interogation about it. On Wed, Feb 29, 2012

Re: Colliding FileWriters

2012-05-01 Thread Eric U
On Mon, Mar 19, 2012 at 3:55 PM, Jonas Sicking wrote: > On Wed, Feb 29, 2012 at 8:44 AM, Eric U wrote: >> On Mon, Feb 27, 2012 at 4:40 PM, Jonas Sicking wrote: >>> On Mon, Feb 27, 2012 at 11:36 PM, Eric U wrote: >> One working subset would be: >> >> * Keep createFileWriter async. >>

Re: Colliding FileWriters

2012-03-19 Thread Jonas Sicking
On Mon, Mar 19, 2012 at 3:10 PM, Eric U wrote: > On Wed, Feb 29, 2012 at 8:44 AM, Eric U wrote: >> On Mon, Feb 27, 2012 at 4:40 PM, Jonas Sicking wrote: >>> On Mon, Feb 27, 2012 at 11:36 PM, Eric U wrote: >> One working subset would be: >> >> * Keep createFileWriter async. >> *

Re: Colliding FileWriters

2012-03-19 Thread Jonas Sicking
On Wed, Feb 29, 2012 at 8:44 AM, Eric U wrote: > On Mon, Feb 27, 2012 at 4:40 PM, Jonas Sicking wrote: >> On Mon, Feb 27, 2012 at 11:36 PM, Eric U wrote: > One working subset would be: > > * Keep createFileWriter async. > * Make it optionally exclusive [possibly by default].  If

Re: Colliding FileWriters

2012-03-19 Thread Eric U
On Wed, Feb 29, 2012 at 8:44 AM, Eric U wrote: > On Mon, Feb 27, 2012 at 4:40 PM, Jonas Sicking wrote: >> On Mon, Feb 27, 2012 at 11:36 PM, Eric U wrote: > One working subset would be: > > * Keep createFileWriter async. > * Make it optionally exclusive [possibly by default].  If

Re: Colliding FileWriters

2012-02-29 Thread Eric U
On Mon, Feb 27, 2012 at 4:40 PM, Jonas Sicking wrote: > On Mon, Feb 27, 2012 at 11:36 PM, Eric U wrote: One working subset would be: * Keep createFileWriter async. * Make it optionally exclusive [possibly by default].  If exclusive, its length member is trustworthy.  If n

Re: Colliding FileWriters

2012-02-29 Thread Jonas Sicking
On Wed, Feb 29, 2012 at 1:56 AM, Glenn Maynard wrote: > On Mon, Feb 27, 2012 at 6:40 PM, Jonas Sicking wrote: >> >> To do the locking without requiring calls to .close() or relying on GC >> we use a similar setup to IndexedDB transactions. I.e. you get an >> object which represents a locked file.

Re: Colliding FileWriters

2012-02-28 Thread Glenn Maynard
On Mon, Feb 27, 2012 at 6:40 PM, Jonas Sicking wrote: > To do the locking without requiring calls to .close() or relying on GC > we use a similar setup to IndexedDB transactions. I.e. you get an > object which represents a locked file. As long as you use that lock to > read from and write to the

Re: Colliding FileWriters

2012-02-27 Thread Jonas Sicking
On Mon, Feb 27, 2012 at 11:36 PM, Eric U wrote: >>> One working subset would be: >>> >>> * Keep createFileWriter async. >>> * Make it optionally exclusive [possibly by default].  If exclusive, >>> its length member is trustworthy.  If not, it can go stale. >>> * Add an append method [needed only f

Re: Colliding FileWriters

2012-02-27 Thread Glenn Maynard
On Mon, Feb 27, 2012 at 4:36 PM, Eric U wrote: > I like exclusive-by-default. Of course, that means that by default > you have to remember to call close() or depend on GC, but that's > probably OK. This sounds bad, because the platform universally goes to careful lengths to avoid exposing GC b

Re: Colliding FileWriters

2012-02-27 Thread Eric U
Sorry about the slow response; I've been busy with dev work, and am now getting back to spec work. On Sat, Jan 21, 2012 at 9:57 PM, Jonas Sicking wrote: > On Wed, Jan 11, 2012 at 1:41 PM, Eric U wrote: >> On Wed, Jan 11, 2012 at 12:25 PM, Jonas Sicking wrote: >>> On Tue, Jan 10, 2012 at 1:32 PM

Re: Colliding FileWriters

2012-01-23 Thread Glenn Maynard
On Mon, Jan 23, 2012 at 4:02 AM, Jonas Sicking wrote: > Yes. How exactly it works is something that is being discussed in this > very thread. The idea discussed so far is to have an explicit > FileWriter.close() call which would release the lock. The lock would > also be released when the FileWri

Re: Colliding FileWriters

2012-01-23 Thread Jonas Sicking
On Sun, Jan 22, 2012 at 7:10 AM, Glenn Maynard wrote: > On Sun, Jan 22, 2012 at 12:57 AM, Jonas Sicking wrote: >> >> myFileEntry.createWriter(function(mywriter) { >>  // write some data >>  mywriter.write(someblob); >>  // wait for "success" >>  mywriter.onwrite = function() { >>    // Read some

Re: Colliding FileWriters

2012-01-22 Thread Glenn Maynard
On Sun, Jan 22, 2012 at 12:57 AM, Jonas Sicking wrote: > myFileEntry.createWriter(function(mywriter) { > // write some data > mywriter.write(someblob); > // wait for "success" > mywriter.onwrite = function() { >// Read some data; >reader = new FileReader; >reader.readAsArrayBuffer

Re: Colliding FileWriters

2012-01-21 Thread Jonas Sicking
On Wed, Jan 11, 2012 at 1:41 PM, Eric U wrote: > On Wed, Jan 11, 2012 at 12:25 PM, Jonas Sicking wrote: >> On Tue, Jan 10, 2012 at 1:32 PM, Eric U wrote: >>> On Tue, Jan 10, 2012 at 1:08 PM, Jonas Sicking wrote: Hi All, We've been looking at implementing FileWriter and had a coup

Re: Colliding FileWriters

2012-01-11 Thread Eric U
On Wed, Jan 11, 2012 at 12:25 PM, Jonas Sicking wrote: > On Tue, Jan 10, 2012 at 1:32 PM, Eric U wrote: >> On Tue, Jan 10, 2012 at 1:08 PM, Jonas Sicking wrote: >>> Hi All, >>> >>> We've been looking at implementing FileWriter and had a couple of questions. >>> >>> First of all, what happens if

Re: Colliding FileWriters

2012-01-11 Thread Jonas Sicking
On Tue, Jan 10, 2012 at 1:32 PM, Eric U wrote: > On Tue, Jan 10, 2012 at 1:08 PM, Jonas Sicking wrote: >> Hi All, >> >> We've been looking at implementing FileWriter and had a couple of questions. >> >> First of all, what happens if multiple pages create a FileWriter for >> the same FileEntry at

Re: Colliding FileWriters

2012-01-10 Thread Eric U
On Tue, Jan 10, 2012 at 1:08 PM, Jonas Sicking wrote: > Hi All, > > We've been looking at implementing FileWriter and had a couple of questions. > > First of all, what happens if multiple pages create a FileWriter for > the same FileEntry at the same time? Will both be able to write to the > file

Colliding FileWriters

2012-01-10 Thread Jonas Sicking
Hi All, We've been looking at implementing FileWriter and had a couple of questions. First of all, what happens if multiple pages create a FileWriter for the same FileEntry at the same time? Will both be able to write to the file at the same time and whoever writes lasts to a given byte wins? Thi