OK, now getting wp messages on screen.
In main html file I am getting "undefined" for "workerPool.sendMessage(data,
childWorkerId)".

I have done, for testing purposes, alert(data); and alert(childWorkerId);
and they are returning the correct values individually. So why is
"console.log(workerPool.sendMessage(data, childWorkerId));" getting
"undefined"? 

In databaseworker.js I now have:
"
try 
         {
       eval("dataarr="+serverresponse);

      }
   catch (ex) 
   {
          wp.sendMessage("Error: No valid data found..",message.sender);
                return;
    }"

And I am getting "Error: No valid data found.." message.

Any more suggestions?
meerkat


> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> On Behalf Of Oblygre
> Sent: Sunday, February 15, 2009 2:52 PM
> To: Gears Users
> Subject: [gears-users] Re: workerpool messages
> 
> 
> A suggestion how to return and show messages from a workerpool.
> Also a replay to your other message :-))
> 
> In your databaseworker.js:
> var wp = google.gears.workerPool;
> wp.onmessage = function(a, b, message) {
>   wp.sendMessage("Ok, started....",message.sender); //Send message bak
> to caller
>   .. other code
> 
> In your calling script:
> workerPool = google.gears.factory.create('beta.workerpool');
>     workerPool.onmessage = function(a, b, message) {
>      alert(message.body); //Show message recived from workerPool
>     }
> var childWorkerId =
>     workerPool.createWorkerFromUrl('databaseworker.js');
>     workerPool.sendMessage(data, childWorkerId);
> 
> 
> 
> On Feb 14, 8:08 pm, meerkat <[email protected]> wrote:
> > Hello,
> > Where and how can I as a programmer see the workerpool messages?
> >
> > I can't see anything in the Firebug console? Do I explicitly have to
> > write to this console? How do I do that? Or is there a better
> > solution?
> > Thanks.
> > meerkat

Reply via email to