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 * Pop PHP Framework (http://www.popphp.org/)
4 *
5 * @link       https://github.com/popphp/popphp-framework
6 * @author     Nick Sagona, III <dev@nolainteractive.com>
7 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
8 * @license    http://www.popphp.org/license     New BSD License
9 */
10
11/**
12 * @namespace
13 */
14namespace Pop\Queue;
15
16use Pop\Application;
17use Pop\Queue\Adapter\AdapterInterface;
18use Pop\Queue\Adapter\TaskAdapterInterface;
19use Pop\Queue\Process\AbstractJob;
20
21/**
22 * Queue interface
23 *
24 * @category   Pop
25 * @package    Pop\Queue
26 * @author     Nick Sagona, III <dev@nolainteractive.com>
27 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
28 * @license    http://www.popphp.org/license     New BSD License
29 * @version    2.0.0
30 */
31interface QueueInterface
32{
33
34    /**
35     * Set name
36     *
37     * @param  string $name
38     * @return QueueInterface
39     */
40    public function setName(string $name): QueueInterface;
41
42    /**
43     * Get name
44     *
45     * @return string
46     */
47    public function getName(): string;
48
49    /**
50     * Has name
51     *
52     * @return bool
53     */
54    public function hasName(): bool;
55
56    /**
57     * Set adapter
58     *
59     * @param  AdapterInterface|TaskAdapterInterface $adapter
60     * @return QueueInterface
61     */
62    public function setAdapter(AdapterInterface|TaskAdapterInterface $adapter): QueueInterface;
63
64    /**
65     * Get adapter
66     *
67     * @return AdapterInterface|TaskAdapterInterface
68     */
69    public function getAdapter(): AdapterInterface|TaskAdapterInterface;
70
71    /**
72     * Get adapter (alias)
73     *
74     * @return AdapterInterface|TaskAdapterInterface
75     */
76    public function adapter(): AdapterInterface|TaskAdapterInterface;
77
78    /**
79     * Work next job
80     *
81     * @param  ?Application $application
82     * @return ?AbstractJob
83     */
84    public function work(?Application $application = null): ?AbstractJob;
85
86    /**
87     * Run schedule
88     *
89     * @param  ?Application $application
90     * @throws Exception|Process\Exception
91     * @return array
92     */
93    public function run(?Application $application = null): array;
94
95    /**
96     * Clear queue
97     *
98     * @return QueueInterface
99     */
100    public function clear(): QueueInterface;
101
102}