[whatwg] Application defined "locks"

On Wed, Sep 9, 2009 at 7:55 PM, Robert O'Callahan <robert at ocallahan.org>wrote:

> On Thu, Sep 10, 2009 at 2:38 PM, Michael Nordman <michaeln at google.com>wrote:
>
>> If this feature existed, we likely would have used it for offline Gmail to
>> coordinate which instance of the app (page with gmail in it) should be
>> responsible for sync'ing the local database with the mail service. In the
>> absence of a feature like this, instead we used the local database itself to
>> register which page was the 'syncagent'. This involved periodically updating
>> the db by the syncagent, and periodic polling by the would be syncagents
>> waiting to possibly take over. Much ugliness.
>> var isSyncAgent = false;
>> window.acquireFlag("syncAgency", function() { isSyncAgent = true; });
>>
>> Much nicer.
>>
>
> How do you deal with the user closing the syncagent while other app
> instances remain open?
>

In our db polling world... that was why the syncagent periodically updated
the db... to say "still alive"... on close it would say "i'm gone" and on
ugly exit, the others would notice the lack of "still alives" and fight
about who was it next. A silly bunch of complexity for something so simple.

In the acquireFlag world... wouldn't the page going away simply relinquish
the flag?


>
> Rob
> --
> "He was pierced for our transgressions, he was crushed for our iniquities;
> the punishment that brought us peace was upon him, and by his wounds we are
> healed. We all, like sheep, have gone astray, each of us has turned to his
> own way; and the LORD has laid on him the iniquity of us all." [Isaiah
> 53:5-6]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090910/3e461912/attachment.htm>

Received on Thursday, 10 September 2009 11:22:28 UTC