Renamed the codebase to RippingCluster

Since the new design is engine agnostic, removed HandBrake from the
class names.
This commit is contained in:
2010-08-25 21:46:50 +01:00
parent 8c5e8f82c1
commit 89ddcba363
46 changed files with 266 additions and 266 deletions

View File

@@ -0,0 +1,48 @@
<?php
class RippingCluster_Worker {
protected $gearman;
public function __construct() {
$this->init();
}
private function init() {
if ($this->gearman) {
return;
}
$config = RippingCluster_Main::instance()->config();
$this->gearman = new GearmanWorker();
$this->gearman->addServers($config->get('rips.job_servers'));
// Load all the plugin classes
echo "Loading Plugins\n";
RippingCluster_Worker_PluginFactory::scan();
foreach (RippingCluster_Worker_PluginFactory::getValidPlugins() as $plugin) {
echo "Grabbing worker functions provided by {$plugin}\n";
$workerFunctions = RippingCluster_Worker_PluginFactory::getPluginWorkerFunctions($plugin);
foreach ($workerFunctions as $function => $callback) {
echo "Adding {$plugin}::{$callback[1]} as {$function}\n";
$this->gearman->addFunction($function, $callback);
}
}
}
public function start() {
while($this->gearman->work()) {
if ($this->gearman->returnCode() != GEARMAN_SUCCESS) {
break;
}
}
return true;
}
}
?>