1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Pyrowman\PheanstalkBundle\Event; |
4
|
|
|
|
5
|
|
|
use Pheanstalk\PheanstalkInterface; |
6
|
|
|
use Symfony\Contracts\EventDispatcher\Event; |
7
|
|
|
|
8
|
|
|
class CommandEvent extends Event |
9
|
|
|
{ |
10
|
|
|
const DELETE = 'pheanstalk.event.delete'; |
11
|
|
|
const WORKFLOW_EXISTS = 'pheanstalk.event.workflow_exists'; |
12
|
|
|
const WORKFLOW_INSTANCES = 'pheanstalk.event.workflow_instances'; |
13
|
|
|
const WORKFLOW_INSTANCES_DETAILS = 'pheanstalk.event.workflow_instances_details'; |
14
|
|
|
const TASK_EXISTS = 'pheanstalk.event.task_exists'; |
15
|
|
|
const TUBE_EXISTS = 'pheanstalk.event.tube_exists'; |
16
|
|
|
const LIST_TUBES = 'pheanstalk.event.list_tubes'; |
17
|
|
|
const LIST_WORKFLOWS = 'pheanstalk.event.list_workflows'; |
18
|
|
|
const PEEK = 'pheanstalk.event.peek'; |
19
|
|
|
const PEEK_READY = 'pheanstalk.event.peek_ready'; |
20
|
|
|
const PUT = 'pheanstalk.event.put'; |
21
|
|
|
const CANCEL = 'pheanstalk.event.cancel'; |
22
|
|
|
const KILL = 'pheanstalk.event.kill'; |
23
|
|
|
const STATS = 'pheanstalk.event.stats'; |
24
|
|
|
const STATS_TUBE = 'pheanstalk.event.stats_tube'; |
25
|
|
|
const STATS_JOB = 'pheanstalk.event.stats_job'; |
26
|
|
|
const CREATE_WORKFLOW = 'pheanstalk.event.create_workflow'; |
27
|
|
|
const CREATE_SCHEDULE = 'pheanstalk.event.create_schedule'; |
28
|
|
|
const UPDATE_SCHEDULE = 'pheanstalk.event.create_schedule'; |
29
|
|
|
const DELETE_SCHEDULE = 'pheanstalk.event.delete_schedule'; |
30
|
|
|
const LIST_SCHEDULE = 'pheanstalk.event.list_schedule'; |
31
|
|
|
const GET_SCHEDULE = 'pheanstalk.event.get_schedule'; |
32
|
|
|
const UPDATE_WORKFLOW = 'pheanstalk.event.update_workflow'; |
33
|
|
|
const CREATE_WORKFLOW_SCHEDULER = 'pheanstalk.event.create_workflow_scheduler'; |
34
|
|
|
const CREATE_TASK = 'pheanstalk.event.create_task'; |
35
|
|
|
const CREATE_TUBE = 'pheanstalk.event.create_tube'; |
36
|
|
|
const UPDATE_TUBE = 'pheanstalk.event.update_tube'; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var PheanstalkInterface |
40
|
|
|
*/ |
41
|
|
|
private $pheanstalk; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var array |
45
|
|
|
*/ |
46
|
|
|
private $payload; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @param PheanstalkInterface $pheanstalk |
50
|
|
|
* @param array $payload |
51
|
|
|
*/ |
52
|
30 |
|
public function __construct(PheanstalkInterface $pheanstalk, array $payload = []) |
53
|
|
|
{ |
54
|
30 |
|
$this->pheanstalk = $pheanstalk; |
55
|
30 |
|
$this->payload = $payload; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @return PheanstalkInterface |
60
|
|
|
*/ |
61
|
4 |
|
public function getPheanstalk() |
62
|
|
|
{ |
63
|
4 |
|
return $this->pheanstalk; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return array |
68
|
|
|
*/ |
69
|
4 |
|
public function getPayload() |
70
|
|
|
{ |
71
|
4 |
|
return $this->payload; |
72
|
|
|
} |
73
|
|
|
} |
74
|
|
|
|