On Mar 13, 2:32 pm, John Tamplin <j...@google.com> wrote:
> On Fri, Mar 13, 2009 at 8:55 AM, lkcl <luke.leigh...@googlemail.com> wrote:
>
> > > > I'm curious why it doesn't just add a
> > > > callback to the module script to avoid the timer?
>
> > >  because in the way i've done it, several modules can be injected
> > > simultaneously.
>
> >  ... so even if you had a callback, you'd still need to go into a
> > timer loop to wait for the first-level dependencies to all be loaded.
>
> No, it just needs a count of the number of times it should be called before
> it calls the real "everything is loaded" callback.

 hiya john, thanks for responding.

 i'm trying to get my head round that idea, in combination with firing
off several script-injections (using scriptnode.src = "./
Window.cache.js" etc. not scriptnode.text = ".......")

 ... and it's not working - the thought of having to protect a counter
with a mutex, in javascript, makes my head spin :)

in pyjamas what i've used is an array, indexed by the module name,
which records the status of where initialisation and loading of a
module has got up to, and it's (currently) the timer that checks this
array and proceeds to "everything is loaded" when it notices that
every single value of the array is greater than.... 3 (or something).

are you saying, then, that it would be reasonable to make this "array-
checking" be activated on a callback?

it would be necessary ensure that the "everything is loaded" is not
called more than once by multiple AJAX loads finishing all at once
resulting in multiple simultaneous callbacks.

all of this was the primary motivation behind doing the timer, but i
really _do_ want a solution to the async module import problem i've
created :)

l.
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to