master

laravel/framework

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

EventMutex.php

TLDR

This file defines an interface for an event mutex in the Illuminate\Console\Scheduling namespace. It includes three methods for creating, checking existence, and clearing event mutexes for a given event.

Methods

create

Attempt to obtain an event mutex for the given event.

exists

Determine if an event mutex exists for the given event.

forget

Clear the event mutex for the given event.

<?php

namespace Illuminate\Console\Scheduling;

interface EventMutex
{
    /**
     * Attempt to obtain an event mutex for the given event.
     *
     * @param  \Illuminate\Console\Scheduling\Event  $event
     * @return bool
     */
    public function create(Event $event);

    /**
     * Determine if an event mutex exists for the given event.
     *
     * @param  \Illuminate\Console\Scheduling\Event  $event
     * @return bool
     */
    public function exists(Event $event);

    /**
     * Clear the event mutex for the given event.
     *
     * @param  \Illuminate\Console\Scheduling\Event  $event
     * @return void
     */
    public function forget(Event $event);
}