Re: Indexed DB + Promises

On Wed, Sep 30, 2015 at 3:13 AM, David Rajchenbach-Teller <
dteller@mozilla.com> wrote:

> Joshua, I am trying to understand how your proposal relates to
> microtasks. Does the extension of lifetime mean that a transaction is
> alive 1/ until the end of the event (including pending microtasks) or 2/
> that it can be kept alive across several events?
>

Wouldn't it have to be 2/ here?  What in the proposal prevents code from
doing this?

  tx.waitUntil(new Promise(function(resolve) {
    setTimeout(resolve, 5000);
  }));

That seems like a good thing to me, though.  It would be nice not to
require code to perform work synchronously on the main thread in order to
have a large transaction.  This tx.waitUntil() now lets code yield the main
thread for large transactions.  If I understand it correctly...

Ben

Received on Wednesday, 30 September 2015 14:25:54 UTC