Re: [IndexedDB] IDBRequest Interface Questions

On Mon, Mar 22, 2010 at 5:17 PM, Shawn Wilsher <sdwilsh@mozilla.com> wrote:

> On 3/22/2010 10:05 AM, Jeremy Orlow wrote:
>
>> I also can't seem to figure out what the success event is supposed to be
>>> for just about anything.  Am I just missing something, or is this not yet
>>> specified?
>>>
>> When onsuccess fires, you can then start the next request.
>>
> Sorry, I guess I'm not being totally clear in what I'm asking.  In the
> Events [1] section, only IDBDatabaseError is specified.  I'm not sure what a
> success message should look like, and that's what I'm asking to be
> clarified.
>
>
>  Do you have anything to say regarding a callback based API vs. event one
>> that inherits from EventTarget?
>>
> By callback you mean passing a callback function into the API calls,
> correct?  Assuming that, I prefer the event based API, but I think the
> current spec could you some modifications to address some concerns that were
> brought up.
>
> As I recall, the issue with the current event-based model is that you can
> only have one request in flight at a time.  I think we could solve this
> problem by having the asynchronous methods return an IDBRequest object
> instead of having a global one for a given context (not completely sure how
> to describe all the places where we have a request attribute but that is
> what I am talking about).  I'm not 100% sure yet if we'd need the request
> attribute on all of these things after doing this, or what it would be in
> each instance.
>

I'm not an expert on JS performance, but I wonder if this would be a
bottleneck in a highly optimized implementation. Then again, maybe it's not
that much worse than simply passing callback functions into the API calls.

Btw, this is one of the things I mentioned on a thread in the last week or
two.  It'd be really nice if you and anyone else could weigh in on the
recent threads about this stuff.....

At this point, I really don't care.  I just want to get all of this settled
on so I don't have to re-write my bindings in a couple weeks.

J

Received on Monday, 22 March 2010 17:30:36 UTC