1 | <?php |
||
9 | class Producer extends AbstractClient { |
||
10 | |||
11 | /** |
||
12 | * Timeout in ms that disque should block the client while replicating the job. |
||
13 | * |
||
14 | * @var int |
||
15 | */ |
||
16 | private $replicationTimeout = 2000; |
||
17 | |||
18 | /** |
||
19 | * Replication factor for jobs. |
||
20 | * |
||
21 | * @var int |
||
22 | */ |
||
23 | private $replicationFactor = 1; |
||
24 | |||
25 | |||
26 | /** |
||
27 | * Enqueue the given job. |
||
28 | * |
||
29 | * @param string $queue |
||
30 | * @param Job $job |
||
31 | * @param int $maxlen specifies that if there are already count messages queued for the specified queue name, |
||
32 | * the message is refused and an error reported to the client. |
||
33 | * @oaram bool $async asks the server to let the command return ASAP and replicate the job to other nodes in the |
||
34 | * background. The job gets queued ASAP, while normally the job is put into the queue only when |
||
35 | * the client gets a positive reply. |
||
36 | * |
||
37 | * @return Job The updated job (e.g. ID set). |
||
38 | */ |
||
39 | 17 | public function addJob($queue, Job $job, $maxlen = 0, $async = false) |
|
66 | |||
67 | /** |
||
68 | * @return int |
||
69 | */ |
||
70 | 18 | public function getReplicationTimeout() |
|
74 | |||
75 | /** |
||
76 | * @param int $replicationTimeout |
||
77 | */ |
||
78 | 1 | public function setReplicationTimeout($replicationTimeout) |
|
82 | |||
83 | /** |
||
84 | * @return int |
||
85 | */ |
||
86 | 18 | public function getReplicationFactor() |
|
90 | |||
91 | /** |
||
92 | * @param int $replicationFactor |
||
93 | */ |
||
94 | 1 | public function setReplicationFactor($replicationFactor) |
|
98 | } |
||
99 |