Skip to content

Commit 6d34b74

Browse files
committed
add queue consumer interface
1 parent 33342d0 commit 6d34b74

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
namespace Enqueue\Consumption;
4+
5+
use Interop\Queue\PsrContext;
6+
use Interop\Queue\PsrProcessor;
7+
use Interop\Queue\PsrQueue;
8+
9+
interface QueueConsumerInterface
10+
{
11+
/**
12+
* Milliseconds.
13+
*/
14+
public function setIdleTimeout(float $timeout): void;
15+
16+
public function getIdleTimeout(): float;
17+
18+
/**
19+
* Milliseconds.
20+
*/
21+
public function setReceiveTimeout(float $timeout): void;
22+
23+
public function getReceiveTimeout(): float;
24+
25+
public function getPsrContext(): PsrContext;
26+
27+
/**
28+
* @param string|PsrQueue $queueName
29+
*/
30+
public function bind($queueName, PsrProcessor $processor): self;
31+
32+
/**
33+
* @param string|PsrQueue $queueName
34+
* @param mixed $queue
35+
*/
36+
public function bindCallback($queue, callable $processor): self;
37+
38+
/**
39+
* Runtime extension - is an extension or a collection of extensions which could be set on runtime.
40+
* Here's a good example: @see LimitsExtensionsCommandTrait.
41+
*
42+
* @param ExtensionInterface|ChainExtension|null $runtimeExtension
43+
*
44+
* @throws \Exception
45+
*/
46+
public function consume(ExtensionInterface $runtimeExtension = null): void;
47+
}

0 commit comments

Comments
 (0)