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 | |
| 22 | namespace oat\taoTaskQueue\model\QueueBroker; |
| 23 | |
| 24 | use oat\taoTaskQueue\model\Task\TaskInterface; |
| 25 | use Psr\Log\LoggerAwareInterface; |
| 26 | |
| 27 | /** |
| 28 | * Interface QueueBrokerInterface |
| 29 | * |
| 30 | * @deprecated Use \oat\tao\model\taskQueue\Queue\Broker\QueueBrokerInterface |
| 31 | * |
| 32 | * @author Gyula Szucs <gyula@taotesting.com> |
| 33 | */ |
| 34 | interface QueueBrokerInterface extends \Countable, LoggerAwareInterface |
| 35 | { |
| 36 | /** |
| 37 | * Set queue name |
| 38 | * |
| 39 | * @param string $name |
| 40 | * @return QueueBrokerInterface |
| 41 | */ |
| 42 | public function setQueueName($name); |
| 43 | |
| 44 | /** |
| 45 | * Creates the queue. |
| 46 | * |
| 47 | * @return mixed |
| 48 | */ |
| 49 | public function createQueue(); |
| 50 | |
| 51 | /** |
| 52 | * Pushes a task into the queue. |
| 53 | * |
| 54 | * @param TaskInterface $task |
| 55 | * @return bool |
| 56 | */ |
| 57 | public function push(TaskInterface $task); |
| 58 | |
| 59 | /** |
| 60 | * Pops a task from the queue. Returns null if there is no more task. |
| 61 | * |
| 62 | * @return null|TaskInterface |
| 63 | */ |
| 64 | public function pop(); |
| 65 | |
| 66 | /** |
| 67 | * If the driver supports it, this will be called when a task has been consumed. |
| 68 | * |
| 69 | * @param TaskInterface $task |
| 70 | */ |
| 71 | public function delete(TaskInterface $task); |
| 72 | |
| 73 | /** |
| 74 | * The amount of tasks that can be received in one pop. |
| 75 | * |
| 76 | * @return int |
| 77 | */ |
| 78 | public function getNumberOfTasksToReceive(); |
| 79 | } |