On Sun, Jun 28, 2009 at 11:20 PM, Sergio Viudes <[email protected]> wrote:

>
> Hello. I started working with gears. Now I'm doing a synchronization
> module for my app. This module gets data from a rpc server and insert
> it to my sqlite local database. I want to use workerPool class to
> maintain UI responsive. I have 2 questions:
>
> 1 - What do you think is better, do asynchronous calls with
> XMLHTTPRequest to get the data from rpc server in main thread and pass
> data to a worker pool that do "inserts" to database or use HTTPRequest
> to get data, and insert it, inside the worker pool?


These pretty much amount to the same thing.

If the request is being initiated by the worker, you have one less step
between reading the response data and inserting into the DB since you won't
have to send a message to a worker... so i would say its slightly preferable
to use HTTPRequest in the worker.


>
> 2 - Can I do synchronous calls inside a workerpool? (I think I can't,
> because HTTPRequest can't do syncrhonous calls, only asyncrhonous...)


Nope... gears HTTPRequest only supports an async interface.

Reply via email to