how one worker can communicate with another

android

#1

how one worker can communicate with another can you please help me on that
i just need demo or code sample that will show communication between one worker to another


#2

Each worker runs it’s own runtime instance, therefore it’s not highly recommended to create multiple workers until it’s really needed.

What kind of communication you are expecting? If you can explain the scenario, people may able to help you better.

In general, you may set / get values in app-settings or communicate using a file / db, you may use a Intent in Android / NSNotificationCenter in iOS.


#3

my sample code:

var worker = new Worker("./secound-worker");
    
global.onmessage = function (msg) {
    console.log('WorkerOnApi ..............')
    try {
        worker.postMessage('');
    
    } catch(e) {
        console.log(e);
    }
}

one worker call to other worker which is mention above but it is not working
so can you please help me out how to do communication between worker