<?php

declare(strict_types=1);

namespace apexl\Io\modules\jobs\Interface;

use Throwable;

interface QueueTaskInterface
{
    public function name(): string;

    public function lock(): void;

    public function unlock(): void;

    public function markProcessed(): void;

    public function run(): void;

    public function handleFailure(string $task, Throwable $throwable): void;

    public function isLocked(): bool;

    /** False when the handler declines to run this job now. */
    public function shouldRun(): bool;

    /** Stand the job down without running or failing it. */
    public function defer(): void;

    public function delete(): void;
}
