node-webworker icon indicating copy to clipboard operation
node-webworker copied to clipboard

is there anyway to figure out if child worker is started(or not)?

Open yyfrankyy opened this issue 12 years ago • 2 comments

When my child worker have some syntax error, or runtime error which outside onmessage, onerror callback, the parent worker does not show any message, just wait there.

Today I just use process.env.NODE_DEBUG = 0x8 to open webworker's debug mode. then I can see wwutil's debug infomation, it does have some debug information when the worker wasn't started correctly, is there any function I can call or event I can listen to and print out those errors(instead just open webworker's debug mode as I am doing now.)?

yyfrankyy avatar Aug 31 '11 05:08 yyfrankyy

Same over here, worker fails silently if anything is wrong.

diversario avatar Sep 19 '11 18:09 diversario

Once strategy I've used before is to write, at the bottom of your worker file:

postMessage( { ready: true } );

...and simply receive that message in your parent after starting the worker to signify that everything went according to plan.

rfunduk avatar Sep 20 '11 20:09 rfunduk