Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 952 by a.p.pandya: uncaught exception: Error in worker 1. Could not process message because worker does not have an onmessage handler.
http://code.google.com/p/gears/issues/detail?id=952

My Application work file with prototype js - but when I convert it into
jquery it fire the exception

What steps will reproduce the problem?
1. Creating workerpool instance
function workerpoolDbSyncInit()
{
        try
        {
                workerPoolDbSync = 
google.gears.factory.create('beta.workerpool', '1.0');
        }
        catch (ex)
        {       
                setError('Could not create worker pool: ' + ex.message);
                return;
        }
        //set the parent's message handler
        workerPoolDbSync.onmessage = parentHandlerDbSync;       
        //setup the entire body of JavsScript code to run in the worker
        var childCode = String(childInitDbSync) +
                        String(childHandlerDbSync) +
                        'childInitDbSync();';  // runs init function
        //create the worker     
        try
        {       
                for (var i=0; i < totalThreadsDbSync; i++)
                {
                        childWpArrayDbSync[i] = 
workerPoolDbSync.createWorker(childCode);
                }
        }
        catch (e)
        {
                setError('Could not create worker: ' + e.message);
        }
}
2.
create parentHandlerDbSync, childInitDbSync, childHandlerDbSync
3.
Now call
workerPoolDbSync.sendMessage(sql, childWpArrayDbSync[threadctr]);

and it's fire the error.

What is the expected output? What do you see instead?
Executing progress bar

What version of the product are you using? On what operating system?
FireFox 3.5.3 and Gear 0.5.30.0 on window XP

Please provide any additional information below.
My Application work file with prototype js - but when I convert it into
jquery - workerpool api can't work

Attachments:
        Error Screen.PNG  28.8 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply via email to