All pastes #1761938 Raw Edit

PHP Gearman Task UP FAIL

public php v1 · immutable
#1761938 ·published 2010-01-22 19:54 UTC
rendered paste body
<?php// -------------------------------------------------------------------// START Basic Client Creatio// Create Client$client = new GearmanClient();$client->addServer("192.168.10.58","4730");$client->addServer("192.168.10.141","4730");// END Basic Client Creation// -------------------------------------------------------------------// Start Tasks$client->addTaskBackground("reverse", "ereh saw adrU");$client->addTaskBackground("reverse", "!dlroW olleH");$client->addTaskBackground("reverse", "ENOytilicaF");$client->addTaskBackground("reverse", "Hello out world!");$client->addTaskHighBackground("reverse", "!!!YTIROIRP HGIH SI SIHT");$client->addTaskHighBackground("reverse", "!!!YTIROIRP HGIH SI SIHT");$client->addTaskHighBackground("reverse", "!!!YTIROIRP HGIH SI SIHT");$client->addTaskHighBackground("reverse", "!!!YTIROIRP HGIH SI SIHT");$client->addTaskLowBackground("reverse", "!!!ytiroirp wol si siht");$client->addTaskLowBackground("reverse", "!!!ytiroirp wol si siht");$client->addTaskLowBackground("reverse", "!!!ytiroirp wol si siht");$client->addTaskLowBackground("reverse", "!!!ytiroirp wol si siht");for($i = 5; $i > 0; $i--){	if($i >= 10)		echo "$i Seconds until task execution!\n";	else if($i != 1 && $i < 10)		echo "0$i Seconds until task execution!\n";	else		echo "0$i Second  until task execution!\n";	sleep(1);}			echo "Start Tasks!\n";$client->runTasks();// AT this point, if server 10.58 is DOWN,// the script Locks up, and sends zero tasks to be Q'd in Server 2.// Sometimes one random job makes it to the server, but that is it.