Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

On Wed, 12 Aug 2009, Aaron Boodman wrote:
> >> 
> >> I also don't see what not having a callback buys. I'm not sure if you
> >> noticed, but I was suggesting that the callback be reentrant. So if you
> >> do this:
> >>
> >> var theResult = null;
> >> database.syncTransaction(function(tx) {
> >>   theResult = tx.executeSQL("select * from ...").rows[0].val;
> >> });
> >> alert(theResult);
> >>
> >> It will do the right thing. Are you concerned that developers won't
> >> realize that the callback is reentrant and will invest more effort
> >> writing their code in an asynchronous style?
> >
> > The only reason for not using callbacks in the sync API was that callbacks
> > are harder to work with than the straight-forward imperative style.
> >
> > I can change the spec to a hybrid style with statements in the imperative
> > form but the transactions themselves using closures. Would that be ok?
> 
> Yes, that is what I was proposing.

Done.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Sunday, 16 August 2009 10:29:00 UTC