GearmanEvents.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. /**
  3. * Gearman Bundle for Symfony2
  4. *
  5. * @author Marc Morera <yuhu@mmoreram.com>
  6. * @since 2013
  7. */
  8. namespace Mmoreram\GearmanBundle;
  9. /**
  10. * Events dispatched by GearmanBundle
  11. */
  12. class GearmanEvents
  13. {
  14. /**
  15. * Sets the callback function to be used when a task is completed
  16. *
  17. * event.name : gearman.client.callback.complete
  18. * event.class : GearmanClientCallbackCompleteEvent
  19. *
  20. * @var string
  21. */
  22. const GEARMAN_CLIENT_CALLBACK_COMPLETE = 'gearman.client.callback.complete';
  23. /**
  24. * Sets the callback function to be used when a task does not complete
  25. * successfully
  26. *
  27. * event.name : gearman.client.callback.fail
  28. * event.class : GearmanClientCallbackFailEvent
  29. *
  30. * @var string
  31. */
  32. const GEARMAN_CLIENT_CALLBACK_FAIL = 'gearman.client.callback.fail';
  33. /**
  34. * Sets the callback function for accepting data packets for a task
  35. *
  36. * event.name : gearman.client.callback.data
  37. * event.class : GearmanClientCallbackDataEvent
  38. *
  39. * @var string
  40. */
  41. const GEARMAN_CLIENT_CALLBACK_DATA = 'gearman.client.callback.data';
  42. /**
  43. * Sets a function to be called when a task is received and queued by the
  44. * Gearman job server
  45. *
  46. * event.name : gearman.client.callback.created
  47. * event.class : GearmanClientCallbackCreatedEvent
  48. *
  49. * @var string
  50. */
  51. const GEARMAN_CLIENT_CALLBACK_CREATED = 'gearman.client.callback.created';
  52. /**
  53. * Specifies a function to call when a worker for a task sends an exception
  54. *
  55. * event.name : gearman.client.callback.exception
  56. * event.class : GearmanClientCallbackExceptionEvent
  57. *
  58. * @var string
  59. */
  60. const GEARMAN_CLIENT_CALLBACK_EXCEPTION = 'gearman.client.callback.exception';
  61. /**
  62. * Sets a callback function used for getting updated status information from
  63. * a worker
  64. *
  65. * event.name : gearman.client.callback.status
  66. * event.class : GearmanClientCallbackStatusEvent
  67. *
  68. * @var string
  69. */
  70. const GEARMAN_CLIENT_CALLBACK_STATUS = 'gearman.client.callback.status';
  71. /**
  72. * Sets a function to be called when a worker sends a warning
  73. *
  74. * event.name : gearman.client.callback.warning
  75. * event.class : GearmanClientCallbackWarningEvent
  76. *
  77. * @var string
  78. */
  79. const GEARMAN_CLIENT_CALLBACK_WARNING = 'gearman.client.callback.warning';
  80. /**
  81. * Sets a function to be called when a worker needs to send back data prior
  82. * to job completion.
  83. *
  84. * A worker can do this when it needs to send updates, send partial results,
  85. * or flush data during long running jobs
  86. *
  87. * event.name : gearman.client.callback.workload
  88. * event.class : GearmanClientCallbackWorkloadEvent
  89. *
  90. * @var string
  91. */
  92. const GEARMAN_CLIENT_CALLBACK_WORKLOAD = 'gearman.client.callback.workload';
  93. }