Ver Fonte

Fixed documentation

Michael Sivolobov há 10 anos atrás
pai
commit
71c4452846
2 ficheiros alterados com 24 adições e 10 exclusões
  1. 3 3
      Resources/docs/client.rst
  2. 21 7
      Resources/docs/kernel_events.rst

+ 3 - 3
Resources/docs/client.rst

@@ -60,9 +60,9 @@ Tasks
 .. code-block:: php
 
     $gearman
-        ->addTask('MmoreramerinoTestBundleServicesMyAcmeWorker~doSomething', 'value1')
-        ->addLowTask('MmoreramerinoTestBundleServicesMyAcmeWorker~doSomething', 'value2')
-        ->addHighBackgroundTask('MmoreramerinoTestBundleServicesMyAcmeWorker~doSomething', 'value3')
+        ->addTask('MmoreramerinoTestBundleServicesMyAcmeWorker~doSomething', 'value1', $context1)
+        ->addLowTask('MmoreramerinoTestBundleServicesMyAcmeWorker~doSomething', 'value2', $context2)
+        ->addHighBackgroundTask('MmoreramerinoTestBundleServicesMyAcmeWorker~doSomething', 'value3', $context3)
         ->runTasks();
 
 - addTask: Adds a task to be run in parallel with other tasks

+ 21 - 7
Resources/docs/kernel_events.rst

@@ -6,8 +6,10 @@ GearmanBundle transforms Gearman callbacks to Symfony2 kernel events.
 Complete Callback
 ~~~~~~~~~~~~~~~~~
 
-This event receives as a parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackCompleteEvent` with one method `$event->getGearmanTask()`. This method returns an instance of `\GearmanTask`.
+This event receives as a parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackCompleteEvent` with methods `$event->getGearmanTask()` and `&$event->getContext()`.
+First method returns an instance of `\GearmanTask`.
 For more information about this GearmanEvent, read [GearmanClient::setCompleteCallback](http://www.php.net/manual/en/gearmanclient.setcompletecallback.php) documentation.
+The second method will return `$context` that you could add in the `addTask()` method.
 
 .. code-block:: yml
 
@@ -20,8 +22,10 @@ For more information about this GearmanEvent, read [GearmanClient::setCompleteCa
 Created Callback
 ~~~~~~~~~~~~~~~~
 
-This event receives as a parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackCreatedEvent` with one method `$event->getGearmanTask()`. This method returns an instance of `\GearmanTask`.
+This event receives as a parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackCreatedEvent` with methods `$event->getGearmanTask()` and `&$event->getContext()`.
+First method returns an instance of `\GearmanTask`.
 For more information about this GearmanEvent, read [GearmanClient::setCreatedCallback](http://www.php.net/manual/en/gearmanclient.setcreatedcallback.php) documentation.
+The second method will return `$context` that you could add in the `addTask()` method.
 
 .. code-block:: yml
 
@@ -34,8 +38,10 @@ For more information about this GearmanEvent, read [GearmanClient::setCreatedCal
 Data Callback
 ~~~~~~~~~~~~~
 
-This event receives as a parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackDataEvent` with one method `$event->getGearmanTask()`. This method returns an instance of `\GearmanTask`.
+This event receives as a parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackDataEvent` with methods `$event->getGearmanTask()` and `&$event->getContext()`.
+First method returns an instance of `\GearmanTask`.
 For more information about this GearmanEvent, read [GearmanClient::setDataCallback](http://www.php.net/manual/en/gearmanclient.setdatacallback.php) documentation.
+The second method will return `$context` that you could add in the `addTask()` method.
 
 .. code-block:: yml
 
@@ -62,8 +68,10 @@ For more information about this GearmanEvent, read [GearmanClient::setExceptionC
 Fail Callback
 ~~~~~~~~~~~~~
 
-This event receives as a parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackFailEvent` with one method `$event->getGearmanTask()`. This method returns an instance of `\GearmanTask`.
+This event receives as a parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackFailEvent` with methods `$event->getGearmanTask()` and `&$event->getContext()`.
+First method returns an instance of `\GearmanTask`.
 For more information about this GearmanEvent, read [GearmanClient::setFailCallback](http://www.php.net/manual/en/gearmanclient.setfailcallback.php) documentation.
+The second method will return `$context` that you could add in the `addTask()` method.
 
 .. code-block:: yml
 
@@ -76,8 +84,10 @@ For more information about this GearmanEvent, read [GearmanClient::setFailCallba
 Status Callback
 ~~~~~~~~~~~~~~~
 
-This event receives as a parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackStatusEvent` with one method `$event->getGearmanTask()`. This method returns an instance of `\GearmanTask`.
+This event receives as a parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackStatusEvent` with methods `$event->getGearmanTask()` and `&$event->getContext()`.
+First method returns an instance of `\GearmanTask`.
 For more information about this GearmanEvent, read [GearmanClient::setStatusCallback](http://www.php.net/manual/en/gearmanclient.setstatuscallback.php) documentation.
+The second method will return `$context` that you could add in the `addTask()` method.
 
 .. code-block:: yml
 
@@ -90,8 +100,10 @@ For more information about this GearmanEvent, read [GearmanClient::setStatusCall
 Warning Callback
 ~~~~~~~~~~~~~~~~
 
-This event receives as parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackWarningEvent` with one method `$event->getGearmanTask()`. This method returns an instance of `\GearmanTask`.
+This event receives as parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackWarningEvent` with methods `$event->getGearmanTask()` and `&$event->getContext()`.
+First method returns an instance of `\GearmanTask`.
 For more information about this GearmanEvent, read [GearmanClient::setWarningCallback](http://www.php.net/manual/en/gearmanclient.setwarningcallback.php) documentation.
+The second method will return `$context` that you could add in the `addTask()` method.
 
 .. code-block:: yml
 
@@ -104,8 +116,10 @@ For more information about this GearmanEvent, read [GearmanClient::setWarningCal
 Workload Callback
 ~~~~~~~~~~~~~~~~~
 
-This event receives as parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackWorkloadEvent` with one method `$event->getGearmanTask()`. This method returns an instance of `\GearmanTask`.
+This event receives as parameter an instance of `Mmoreram\GearmanBundle\Event\GearmanClientCallbackWorkloadEvent` with methods `$event->getGearmanTask()` and `&$event->getContext()`.
+First method returns an instance of `\GearmanTask`.
 For more information about this GearmanEvent, read [GearmanClient::setWorkloadCallback](http://www.php.net/manual/en/gearmanclient.setworkloadcallback.php) documentation.
+The second method will return `$context` that you could add in the `addTask()` method.
 
 .. code-block:: yml