GearmanAnnotations.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. * Name of worker
  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 $iterations = 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. * Default method to call for all jobs inside this work
  38. *
  39. * @var string
  40. */
  41. public $defaultMethod = null;
  42. /**
  43. * Service typeof Class. If it's defined, object will be instanced throught service dependence injection.
  44. * Otherwise, class will be instance with new() method
  45. *
  46. * @var string
  47. */
  48. public $service = null;
  49. }
  50. /** @Annotation */
  51. final class Job extends Annotation
  52. {
  53. /**
  54. * Method name to assign into job
  55. *
  56. * @var string
  57. */
  58. public $name = null;
  59. /**
  60. * Description of Job
  61. *
  62. * @var string
  63. */
  64. public $description = null;
  65. /**
  66. * Number of iterations specified for this job
  67. *
  68. * @var integer
  69. */
  70. public $iterations = null;
  71. /**
  72. * Servers assigned for this job to be executed
  73. *
  74. * @var mixed
  75. */
  76. public $servers = null;
  77. /**
  78. * Default method to call for this job
  79. *
  80. * @var string
  81. */
  82. public $defaultMethod = null;
  83. }