On Apr 16, 11:42 am, Jason Essington <[email protected]>
wrote:
> I am going on some stale gears info here, but ...
> On Apr 15, 2009, at 3:15 PM, fvisticot wrote:
>
>
>
> > I would like to call GWT RPC method from my worker pool for
> > synchronization process between dbs (client and server)
> > It seems that the WorkerPool can only call javascript file or text
> > script...
>
> > GWT purpose is to generate javascript as well so it is not possible
> > to:
> > 1. develop the method/class to invoke in the WorkerPool with GWT.
>
> yeah sure, create a new GWT module for each worker. there is a GALGWT  
> project that should have some Gears integration stuff in it.

In theory, it would be possible to use GWT to generate code for
workers in the worker pool, but I've never done it.  If someone else
has, I'd love to hear about it.  A new linker or manual trickery would
be needed to eliminate relying on browser load event logic, which is
inappropriate for WorkerPool threads.

> > 2. compile this method with GWT compiler
>
> yup, but you'll need to use the single script linker

Unfortunately,  the reliance on browser events and window objects is
present even in the SingleScriptLinker, but you could probably work
around it.

> > 3. call this method from the WorkerPool
>
> That one is one that I'm not sure on. At one time it was possible to  
> issue XHR from a worker, but I was told that was a bug. I'm not sure  
> if worker XHRs have been added or not. I'm sure someone that is more  
> up to date on Gears can answer that one for you.

There is now a way to call an XHR using the HttpRequest object in
WorkerPool, but again, since I haven't written code in GWT for a
WorkerPool, I haven't tried to integrate GWT RPC.

Since GWT RPC is asyncronous, you could do the RPCs in the main thread
and then send the result data as messages to Worker threads.

-Eric.

Reply via email to