summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/scheduler/src/Contract/Task.php
blob: db09ddca39553fdab8d90c27285062e656b0a2b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

namespace ipl\Scheduler\Contract;

use Ramsey\Uuid\UuidInterface;
use React\Promise\ExtendedPromiseInterface;

interface Task
{
    /**
     * Get the name of this task
     *
     * @return string
     */
    public function getName(): string;

    /**
     * Get unique identifier of this task
     *
     * @return UuidInterface
     */
    public function getUuid(): UuidInterface;

    /**
     * Get the description of this task
     *
     * @return ?string
     */
    public function getDescription(): ?string;

    /**
     * Run this tasks operations
     *
     * This commits the actions in a non-blocking fashion to the event loop and yields a deferred promise
     *
     * @return ExtendedPromiseInterface
     */
    public function run(): ExtendedPromiseInterface;
}