Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2017 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
19 *
20 */
21
22namespace oat\tao\model\taskQueue;
23
24use oat\oatbox\PhpSerializable;
25use oat\tao\model\taskQueue\Queue\Broker\QueueBrokerInterface;
26use oat\tao\model\taskQueue\Task\TaskInterface;
27use Psr\Log\LoggerAwareInterface;
28use Zend\ServiceManager\ServiceLocatorAwareInterface;
29
30/**
31 * @author Gyula Szucs <gyula@taotesting.com>
32 */
33interface QueueInterface extends QueuerInterface, LoggerAwareInterface, PhpSerializable, ServiceLocatorAwareInterface
34{
35    /**
36     * QueueInterface constructor.
37     *
38     * @param string               $name
39     * @param QueueBrokerInterface $broker
40     * @param int                  $weight
41     */
42    public function __construct($name, QueueBrokerInterface $broker, $weight = 1);
43
44    /**
45     * @return string
46     */
47    public function __toString();
48
49    /**
50     * Initialize queue.
51     *
52     * @return void
53     */
54    public function initialize();
55
56    /**
57     * Returns queue name.
58     *
59     * @return string
60     */
61    public function getName();
62
63    /**
64     * Returns queue weight.
65     *
66     * @return int
67     */
68    public function getWeight();
69
70    /**
71     * @param int $weight
72     * @return QueueInterface
73     */
74    public function setWeight($weight);
75
76    /**
77     * Is the given queue a sync queue?
78     *
79     * @return bool
80     */
81    public function isSync();
82
83    /**
84     * The amount of tasks that can be received in one pop by this queue.
85     *
86     * @return int
87     */
88    public function getNumberOfTasksToReceive();
89
90    /**
91     * Set new broker.
92     *
93     * @param QueueBrokerInterface $broker
94     * @return QueueInterface
95     */
96    public function setBroker(QueueBrokerInterface $broker);
97
98    public function getBroker(): QueueBrokerInterface;
99}