|
@@ -50,6 +50,13 @@ class GearmanClient extends AbstractGearmanService
|
|
*/
|
|
*/
|
|
protected $defaultServers;
|
|
protected $defaultServers;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @var array
|
|
|
|
+ *
|
|
|
|
+ * Set default settings
|
|
|
|
+ */
|
|
|
|
+ protected $settings;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* Set default servers
|
|
* Set default servers
|
|
@@ -80,6 +87,20 @@ class GearmanClient extends AbstractGearmanService
|
|
return $this;
|
|
return $this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Set default settings
|
|
|
|
+ *
|
|
|
|
+ * @param array $settings
|
|
|
|
+ *
|
|
|
|
+ * @return GearmanClient self Object
|
|
|
|
+ */
|
|
|
|
+ public function setDefaultSettings($settings)
|
|
|
|
+ {
|
|
|
|
+ $this->settings = $settings;
|
|
|
|
+
|
|
|
|
+ return $this;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* Set server to client. Empty all servers and set this one
|
|
* Set server to client. Empty all servers and set this one
|
|
@@ -548,7 +569,10 @@ class GearmanClient extends AbstractGearmanService
|
|
{
|
|
{
|
|
$gearmanClient = new \GearmanClient();
|
|
$gearmanClient = new \GearmanClient();
|
|
$this->assignServers($gearmanClient);
|
|
$this->assignServers($gearmanClient);
|
|
- $this->gearmanCallbacks->assignTaskCallbacks($gearmanClient);
|
|
|
|
|
|
+
|
|
|
|
+ if ($this->settings['callbacks']) {
|
|
|
|
+ $this->gearmanCallbacks->assignTaskCallbacks($gearmanClient);
|
|
|
|
+ }
|
|
|
|
|
|
foreach ($this->taskStructure as $task) {
|
|
foreach ($this->taskStructure as $task) {
|
|
|
|
|