Skip to content

Commit f4fffbd

Browse files
committed
Sync with cnages in queue interop.
1 parent 6d61c3c commit f4fffbd

10 files changed

Lines changed: 389 additions & 2 deletions

File tree

‎composer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"enqueue/simple-client": "*@dev",
2020
"enqueue/test": "*@dev",
2121
"enqueue/async-event-dispatcher": "*@dev",
22-
"queue-interop/queue-interop": "^0.5@dev",
23-
"queue-interop/queue-spec": "^0.5@dev",
22+
"queue-interop/queue-interop": "dev-develop",
23+
"queue-interop/queue-spec": "dev-develop",
2424

2525
"phpunit/phpunit": "^5",
2626
"doctrine/doctrine-bundle": "~1.2",

‎pkg/amqp-ext/AmqpProducer.php‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Enqueue\AmqpExt;
44

5+
use Interop\Queue\CompletionListener;
56
use Interop\Queue\InvalidDestinationException;
67
use Interop\Queue\InvalidMessageException;
78
use Interop\Queue\PsrDestination;
@@ -11,6 +12,16 @@
1112

1213
class AmqpProducer implements PsrProducer
1314
{
15+
/**
16+
* @var CompletionListener
17+
*/
18+
private $completionListener;
19+
20+
/**
21+
* @var float
22+
*/
23+
private $deliveryDelay = PsrMessage::DEFAULT_DELIVERY_DELAY;
24+
1425
/**
1526
* @var \AMQPChannel
1627
*/
@@ -71,4 +82,36 @@ public function send(PsrDestination $destination, PsrMessage $message)
7182
);
7283
}
7384
}
85+
86+
/**
87+
* {@inheritdoc}
88+
*/
89+
public function setCompletionListener(CompletionListener $listener = null)
90+
{
91+
$this->completionListener = $listener;
92+
}
93+
94+
/**
95+
* @return CompletionListener|null
96+
*/
97+
public function getCompletionListener()
98+
{
99+
return $this->completionListener;
100+
}
101+
102+
/**
103+
* {@inheritdoc}
104+
*/
105+
public function getDeliveryDelay()
106+
{
107+
return $this->deliveryDelay;
108+
}
109+
110+
/**
111+
* {@inheritdoc}
112+
*/
113+
public function setDeliveryDelay($deliveryDelay)
114+
{
115+
$this->deliveryDelay = $deliveryDelay;
116+
}
74117
}

‎pkg/dbal/DbalProducer.php‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Doctrine\DBAL\Types\Type;
66
use Enqueue\Util\JSON;
7+
use Interop\Queue\CompletionListener;
78
use Interop\Queue\Exception;
89
use Interop\Queue\InvalidDestinationException;
910
use Interop\Queue\InvalidMessageException;
@@ -13,6 +14,16 @@
1314

1415
class DbalProducer implements PsrProducer
1516
{
17+
/**
18+
* @var CompletionListener
19+
*/
20+
private $completionListener;
21+
22+
/**
23+
* @var float
24+
*/
25+
private $deliveryDelay = PsrMessage::DEFAULT_DELIVERY_DELAY;
26+
1627
/**
1728
* @var DbalContext
1829
*/
@@ -85,4 +96,36 @@ public function send(PsrDestination $destination, PsrMessage $message)
8596
throw new Exception('The transport fails to send the message due to some internal error.', null, $e);
8697
}
8798
}
99+
100+
/**
101+
* {@inheritdoc}
102+
*/
103+
public function setCompletionListener(CompletionListener $listener = null)
104+
{
105+
$this->completionListener = $listener;
106+
}
107+
108+
/**
109+
* @return CompletionListener|null
110+
*/
111+
public function getCompletionListener()
112+
{
113+
return $this->completionListener;
114+
}
115+
116+
/**
117+
* {@inheritdoc}
118+
*/
119+
public function getDeliveryDelay()
120+
{
121+
return $this->deliveryDelay;
122+
}
123+
124+
/**
125+
* {@inheritdoc}
126+
*/
127+
public function setDeliveryDelay($deliveryDelay)
128+
{
129+
$this->deliveryDelay = $deliveryDelay;
130+
}
88131
}

‎pkg/fs/FsProducer.php‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Enqueue\Fs;
44

5+
use Interop\Queue\CompletionListener;
56
use Interop\Queue\InvalidDestinationException;
67
use Interop\Queue\InvalidMessageException;
78
use Interop\Queue\PsrDestination;
@@ -11,6 +12,16 @@
1112

1213
class FsProducer implements PsrProducer
1314
{
15+
/**
16+
* @var CompletionListener
17+
*/
18+
private $completionListener;
19+
20+
/**
21+
* @var float
22+
*/
23+
private $deliveryDelay = PsrMessage::DEFAULT_DELIVERY_DELAY;
24+
1425
/**
1526
* @var FsContext
1627
*/
@@ -56,4 +67,36 @@ public function send(PsrDestination $destination, PsrMessage $message)
5667
fwrite($file, $rawMessage);
5768
});
5869
}
70+
71+
/**
72+
* {@inheritdoc}
73+
*/
74+
public function setCompletionListener(CompletionListener $listener = null)
75+
{
76+
$this->completionListener = $listener;
77+
}
78+
79+
/**
80+
* @return CompletionListener|null
81+
*/
82+
public function getCompletionListener()
83+
{
84+
return $this->completionListener;
85+
}
86+
87+
/**
88+
* {@inheritdoc}
89+
*/
90+
public function getDeliveryDelay()
91+
{
92+
return $this->deliveryDelay;
93+
}
94+
95+
/**
96+
* {@inheritdoc}
97+
*/
98+
public function setDeliveryDelay($deliveryDelay)
99+
{
100+
$this->deliveryDelay = $deliveryDelay;
101+
}
59102
}

‎pkg/gearman/GearmanProducer.php‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Enqueue\Gearman;
44

5+
use Interop\Queue\CompletionListener;
56
use Interop\Queue\InvalidDestinationException;
67
use Interop\Queue\InvalidMessageException;
78
use Interop\Queue\PsrDestination;
@@ -10,6 +11,16 @@
1011

1112
class GearmanProducer implements PsrProducer
1213
{
14+
/**
15+
* @var CompletionListener
16+
*/
17+
private $completionListener;
18+
19+
/**
20+
* @var float
21+
*/
22+
private $deliveryDelay = PsrMessage::DEFAULT_DELIVERY_DELAY;
23+
1324
/**
1425
* @var \GearmanClient
1526
*/
@@ -41,4 +52,36 @@ public function send(PsrDestination $destination, PsrMessage $message)
4152
throw new \GearmanException(sprintf('The return code is not %s (GEARMAN_SUCCESS) but %s', \GEARMAN_SUCCESS, $code));
4253
}
4354
}
55+
56+
/**
57+
* {@inheritdoc}
58+
*/
59+
public function setCompletionListener(CompletionListener $listener = null)
60+
{
61+
$this->completionListener = $listener;
62+
}
63+
64+
/**
65+
* @return CompletionListener|null
66+
*/
67+
public function getCompletionListener()
68+
{
69+
return $this->completionListener;
70+
}
71+
72+
/**
73+
* {@inheritdoc}
74+
*/
75+
public function getDeliveryDelay()
76+
{
77+
return $this->deliveryDelay;
78+
}
79+
80+
/**
81+
* {@inheritdoc}
82+
*/
83+
public function setDeliveryDelay($deliveryDelay)
84+
{
85+
$this->deliveryDelay = $deliveryDelay;
86+
}
4487
}

‎pkg/null/NullProducer.php‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,59 @@
22

33
namespace Enqueue\Null;
44

5+
use Interop\Queue\CompletionListener;
56
use Interop\Queue\PsrDestination;
67
use Interop\Queue\PsrMessage;
78
use Interop\Queue\PsrProducer;
89

910
class NullProducer implements PsrProducer
1011
{
12+
/**
13+
* @var CompletionListener
14+
*/
15+
private $completionListener;
16+
17+
/**
18+
* @var float
19+
*/
20+
private $deliveryDelay = PsrMessage::DEFAULT_DELIVERY_DELAY;
21+
1122
/**
1223
* {@inheritdoc}
1324
*/
1425
public function send(PsrDestination $destination, PsrMessage $message)
1526
{
1627
}
28+
29+
/**
30+
* {@inheritdoc}
31+
*/
32+
public function setCompletionListener(CompletionListener $listener = null)
33+
{
34+
$this->completionListener = $listener;
35+
}
36+
37+
/**
38+
* @return CompletionListener|null
39+
*/
40+
public function getCompletionListener()
41+
{
42+
return $this->completionListener;
43+
}
44+
45+
/**
46+
* {@inheritdoc}
47+
*/
48+
public function getDeliveryDelay()
49+
{
50+
return $this->deliveryDelay;
51+
}
52+
53+
/**
54+
* {@inheritdoc}
55+
*/
56+
public function setDeliveryDelay($deliveryDelay)
57+
{
58+
$this->deliveryDelay = $deliveryDelay;
59+
}
1760
}

‎pkg/pheanstalk/PheanstalkProducer.php‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Enqueue\Pheanstalk;
44

5+
use Interop\Queue\CompletionListener;
56
use Interop\Queue\InvalidDestinationException;
67
use Interop\Queue\InvalidMessageException;
78
use Interop\Queue\PsrDestination;
@@ -11,6 +12,16 @@
1112

1213
class PheanstalkProducer implements PsrProducer
1314
{
15+
/**
16+
* @var CompletionListener
17+
*/
18+
private $completionListener;
19+
20+
/**
21+
* @var float
22+
*/
23+
private $deliveryDelay = PsrMessage::DEFAULT_DELIVERY_DELAY;
24+
1425
/**
1526
* @var Pheanstalk
1627
*/
@@ -51,4 +62,36 @@ public function send(PsrDestination $destination, PsrMessage $message)
5162
$message->getTimeToRun()
5263
);
5364
}
65+
66+
/**
67+
* {@inheritdoc}
68+
*/
69+
public function setCompletionListener(CompletionListener $listener = null)
70+
{
71+
$this->completionListener = $listener;
72+
}
73+
74+
/**
75+
* @return CompletionListener|null
76+
*/
77+
public function getCompletionListener()
78+
{
79+
return $this->completionListener;
80+
}
81+
82+
/**
83+
* {@inheritdoc}
84+
*/
85+
public function getDeliveryDelay()
86+
{
87+
return $this->deliveryDelay;
88+
}
89+
90+
/**
91+
* {@inheritdoc}
92+
*/
93+
public function setDeliveryDelay($deliveryDelay)
94+
{
95+
$this->deliveryDelay = $deliveryDelay;
96+
}
5497
}

0 commit comments

Comments
 (0)