benlilaj / gears

Automatically exported from code.google.com/p/gears
0 stars 1 forks source link

uncaught exception: Error in worker 1. Could not process message because worker does not have an onmessage handler. #952

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by a.p.pan...@gmail.com on 30 Sep 2009 at 6:33

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry one more thing

On 
What steps will reproduce the problem?
1. Creating workerpool instance

I am receiving following error

uncaught exception: Error in worker 1 at line 2. alert is not defined

My Application work file with prototype js - but when I convert it into
jquery - workerpool api can't work

Original comment by a.p.pan...@gmail.com on 30 Sep 2009 at 6:41