master

laravel/framework

Last updated at: 29/12/2023 09:20

CommandMutex.php

TLDR

This file defines an interface named CommandMutex that acts as a contract for classes implementing command mutex functionality. It includes three methods: create(), exists(), and forget().

Methods

create($command)

Attempt to obtain a command mutex for the given command.

exists($command)

Determine if a command mutex exists for the given command.

forget($command)

Release the mutex for the given command.

<?php

namespace Illuminate\Console;

interface CommandMutex
{
    /**
     * Attempt to obtain a command mutex for the given command.
     *
     * @param  \Illuminate\Console\Command  $command
     * @return bool
     */
    public function create($command);

    /**
     * Determine if a command mutex exists for the given command.
     *
     * @param  \Illuminate\Console\Command  $command
     * @return bool
     */
    public function exists($command);

    /**
     * Release the mutex for the given command.
     *
     * @param  \Illuminate\Console\Command  $command
     * @return bool
     */
    public function forget($command);
}