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