Is it possible to send back data from a gearman worker that runs in the background (with PHP)?
I know that I can pass a status (numerator/denominator) to the client but I need to "return" data.
The background is that I need to call workers on different servers and if they don't respond, the main script should continue. So I think I have to run the workers in the background. But I need some data from them.
UPDATE:
It seems not to be possible. I think I have either to store the data in a shared database or to write it from the remote server to the local server or to read it from the remote server or to make something like this:
shell_exec('gearman -f getdata-192-168-200-1 > /my/path/ 2>&1 & echo $!');
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…