GearmanAnnotations.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * Gearman annotations driver
  4. *
  5. * @author Marc Morera <marc@ulabox.com>
  6. */
  7. namespace Mmoreramerino\GearmanBundle\Driver\Gearman;
  8. use Doctrine\Common\Annotations\Annotation;
  9. /** @Annotation */
  10. final class Work extends Annotation
  11. {
  12. /**
  13. * Number of iterations specified for all jobs inside Work
  14. *
  15. * @var integer
  16. */
  17. public $name = null;
  18. /**
  19. * Description of Worker
  20. *
  21. * @var string
  22. */
  23. public $description = null;
  24. /**
  25. * Number of iterations specified for all jobs inside Work
  26. *
  27. * @var integer
  28. */
  29. public $iter = null;
  30. /**
  31. * Servers assigned for all jobs of this work to be executed
  32. *
  33. * @var mixed
  34. */
  35. public $servers = null;
  36. /**
  37. * Service typeof Class. If it's defined, object will be instanced throught service dependence injection.
  38. * Otherwise, class will be instance with new() method
  39. *
  40. * @var string
  41. */
  42. public $service = null;
  43. }
  44. /** @Annotation */
  45. final class Job extends Annotation
  46. {
  47. /**
  48. * Method name to assign into job
  49. *
  50. * @var string
  51. */
  52. public $name = null;
  53. /**
  54. * Description of Job
  55. *
  56. * @var string
  57. */
  58. public $description = null;
  59. /**
  60. * Number of iterations specified for this job
  61. *
  62. * @var integer
  63. */
  64. public $iter = null;
  65. /**
  66. * Servers assigned for this job to be executed
  67. *
  68. * @var mixed
  69. */
  70. public $servers = null;
  71. }