summaryrefslogtreecommitdiffstats
path: root/gearman
diff options
context:
space:
mode:
authorBjörn Geiger2011-07-13 13:13:54 +0200
committerBjörn Geiger2011-07-13 13:13:54 +0200
commit0b3411255e9ec9a8b62f8e535b4e256ecbbdc9b7 (patch)
treed198203940a9f1a16aa5c3a624eb9fb5430a3802 /gearman
parentminor (diff)
downloadpoolctrl-0b3411255e9ec9a8b62f8e535b4e256ecbbdc9b7.tar.gz
poolctrl-0b3411255e9ec9a8b62f8e535b4e256ecbbdc9b7.tar.xz
poolctrl-0b3411255e9ec9a8b62f8e535b4e256ecbbdc9b7.zip
Fehler korrigiert
Diffstat (limited to 'gearman')
-rw-r--r--gearman/bootWorker.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/gearman/bootWorker.php b/gearman/bootWorker.php
index 7e85054..98065f9 100644
--- a/gearman/bootWorker.php
+++ b/gearman/bootWorker.php
@@ -1,16 +1,16 @@
<?php
function bootTask(GearmanJob $job) {
- echo "test";
-
$client= new GearmanClient();
$client->addServer();
- $ipString = job.data.strip();
+ $ipString = $job->workload();
$ipArray = explode(', ', $ipString);
if(is_array($ipArray)) {
foreach($ipArray as $ip) {
- $result[] = $client->do("ping", $ip);
+ $result = $client->do("ping", $ip);
+ echo $result;
+ $results[] = $result;
}
}
@@ -19,11 +19,10 @@ function bootTask(GearmanJob $job) {
$result = "bad return code\n" . $gmc->error();
}
- return $result;
+ return $results;
}
$worker = new GearmanWorker();
$worker->addServer();
$worker->addFunction("boot", "bootTask");
-while ($worker->work());
-?> \ No newline at end of file
+while ($worker->work()); \ No newline at end of file