mirror of
https://gitee.com/ledc/IYUUAutoReseed
synced 2025-05-04 00:03:25 +00:00
33 lines
500 B
PHP
33 lines
500 B
PHP
<?php
|
|
|
|
echo "Starting\n";
|
|
|
|
$gmworker = new GearmanWorker();
|
|
$gmworker->addServer('10.10.10.238');
|
|
$gmworker->addFunction("reverse", "reverse_fn");
|
|
|
|
print "Waiting for job...\n";
|
|
while($gmworker->work())
|
|
{
|
|
if ($gmworker->returnCode() != GEARMAN_SUCCESS)
|
|
{
|
|
echo "return_code: " . $gmworker->returnCode() . "\n";
|
|
break;
|
|
}
|
|
//break;
|
|
}
|
|
|
|
function reverse_fn($job)
|
|
{
|
|
sleep(3);
|
|
echo $job->workload()."\n";
|
|
return strrev($job->workload());
|
|
}
|
|
|
|
|
|
echo "hello\n";
|
|
?>
|
|
|
|
|
|
|