-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathEagerAcknowledgementHandler.php
69 lines (62 loc) · 1.63 KB
/
EagerAcknowledgementHandler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* This file is part of graze/queue.
*
* Copyright (c) 2015 Nature Delivered Ltd. <https://www.graze.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license https://github.com/graze/queue/blob/master/LICENSE MIT
*
* @link https://github.com/graze/queue
*/
namespace Graze\Queue\Handler;
use Graze\Queue\Adapter\AdapterInterface;
use Graze\Queue\Message\MessageInterface;
class EagerAcknowledgementHandler extends AbstractAcknowledgementHandler
{
/**
* @param MessageInterface $message
* @param AdapterInterface $adapter
* @param mixed $result
*/
protected function acknowledge(
MessageInterface $message,
AdapterInterface $adapter,
$result = null
) {
$adapter->acknowledge([$message]);
}
/**
* @param MessageInterface $message
* @param AdapterInterface $adapter
* @param int $duration
*/
protected function extend(
MessageInterface $message,
AdapterInterface $adapter,
$duration
) {
$adapter->extend([$message], $duration);
}
/**
* @param MessageInterface $message
* @param AdapterInterface $adapter
* @param mixed $result
*/
protected function reject(
MessageInterface $message,
AdapterInterface $adapter,
$result = null
) {
$adapter->reject([$message]);
}
/**
* @param AdapterInterface $adapter
*/
protected function flush(AdapterInterface $adapter)
{
// Nothing to flush
}
}