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\Adapter;
15
16use Pop\Queue\Process\Task;
17
18/**
19 * Adapter interface
20 *
21 * @category   Pop
22 * @package    Pop\Queue
23 * @author     Nick Sagona, III <dev@nolainteractive.com>
24 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
25 * @license    http://www.popphp.org/license     New BSD License
26 * @version    2.0.0
27 */
28interface TaskAdapterInterface
29{
30
31    /**
32     * Schedule job with queue
33     *
34     * @param  Task $task
35     * @return TaskAdapterInterface
36     */
37    public function schedule(Task $task): TaskAdapterInterface;
38
39    /**
40     * Get scheduled tasks
41     *
42     * @return array
43     */
44    public function getTasks(): array;
45
46    /**
47     * Get scheduled task
48     *
49     * @param  string $taskId
50     * @return ?Task
51     */
52    public function getTask(string $taskId): ?Task;
53
54    /**
55     * Update scheduled task
56     *
57     * @param  Task $task
58     * @return TaskAdapterInterface
59     */
60    public function updateTask(Task $task): TaskAdapterInterface;
61
62    /**
63     * Remove scheduled task
64     *
65     * @param  string $taskId
66     * @return TaskAdapterInterface
67     */
68    public function removeTask(string $taskId): TaskAdapterInterface;
69
70    /**
71     * Get scheduled tasks count
72     *
73     * @return int
74     */
75    public function getTaskCount(): int;
76
77    /**
78     * Has scheduled tasks
79     *
80     * @return bool
81     */
82    public function hasTasks(): bool;
83
84    /**
85     * Clear all scheduled task
86     *
87     * @return TaskAdapterInterface
88     */
89    public function clearTasks(): TaskAdapterInterface;
90
91}